0
Timestamp[] lastreply = new Timestamp[100];
replyr = lastreplyr[i].getTime();
System.out.println("Replyr: "+replyr);
lastreply[count].setTime(replyr);
System.out.println("lastreply: "+lastreply[count]);
コンソールにNullPointer例外を投げる:のsetTime()
Replyr: 1321116689000
java.lang.NullPointerException
at website.web.InboxReader.getLastReply(InboxReader.java:937)
at website.web.InboxReader.main(InboxReader.java:55)
なぜlastreplyヌルなっていますか?コードでは、カウントは0から始まります。
ありがとうございます。
nullの場合、replyrがnullではないのはなぜですか? – Ava
@PetarIvanov - コピー&ペーストエラーが発生しました。 'lastreplyr'は問題ありません。新しい' TimeStamp'オブジェクトを割り当てていない 'lastreply'配列です。それを固定:) –
ああ、右!ありがとう –