NullPointerException
1
Name:
Anonymous
2011-08-17 12:28
What is this and how do I make it go away?
2
Name:
Anonymous
2011-08-17 12:32
Stop using Java.
3
Name:
Anonymous
2011-08-17 12:55
4
Name:
Anonymous
2011-08-17 12:55
You get this exception when accessing a variable which does not contain a reference to an object, but the null-pointer.
You should get a file and a line-number with your exception. Find the line for which the NullPointerException has been called and check which variable is causing this problem.
Now think HARD why this variable hasn't been initialized.
5
Name:
Anonymous
2011-08-17 13:07
>>2
Correct.
THREAD OVER
>>4
DON'T HELP HIM!!!
6
Name:
Anonymous
2011-08-17 13:16
>>4
How can a reference and a pointer be stored in the same type?
7
Name:
Anonymous
2011-08-17 13:19
>>6
Re-read what #4 said again, or stop trolling. Either way.
8
Name:
Anonymous
2011-08-17 13:20
>>6
"reference" and "pointer" are synonyms in Java. It doesn't have two incompatible solutions for the same problem like C++.
9
Name:
Anonymous
2011-08-17 13:31
To solve the problem - surround the lines causing the problem with a try/catch block.
10
Name:
Anonymous
2011-08-17 15:02
_∧_∧_∧_∧_∧_∧_∧_∧_∧_
デケデケ | NULLPO!!ヌルポ!!NULLPO!!ヌルポ!!NULLPO!! |
ドコドコ < ぬるぽ!ぬるぽ!ぬるぽ!ぬるぽぬるぽ! >
☆ ドムドム | ぬぬぬるぽ!ぬるぽ!ぬるっぷぉ~!! .|
☆. ダダダダ!  ̄∨ ̄∨ ̄∨ ̄∨ ̄∨ ̄∨ ̄∨ ̄∨ ̄∨ ̄
ドシャーン! ヽ オラオラッ!! ♪
=≡= ∧_∧ ☆
♪ / 〃(・∀・ #) / シャンシャン
♪ 〆 ┌\と\と.ヾ ∈≡∋ゞ
|| γ ⌒ヽヽコ ノ ||
|| ΣΣ .|:::|∪〓 || ♪
./|\人 _.ノノ _||_. /|\
11
Name:
Anonymous
2011-08-17 15:14
On Error Goto Gah
12
Name:
Anonymous
2011-08-17 18:56
#include <ooc/lang/NullPointerException.h>
int main(void) {
throw(new(NullPointerException(),
"Why you made bro?"));
}
13
Name:
n3n7i
2011-08-17 21:44
if(MyPointer==NULL){ printf("Barf\n"); return;}
14
Name:
Anonymous
2011-08-18 1:06
Exceptions are overly weak and complicated and were conceived in a time when computation was not yet mainstream or accessible.
Error handling like C style error handling is a much better attempt at trying to solve the problems error handlers first set out to solve.