NullPointerException
Posted In:
C++
,
Technology
.
By Sid
When dealing with an array of objects:
Object objectArr[] = new Object[MAXSIZE];
This statements only allocates space for the array, referring to any of its elements after this declaration will only result in a NullPointerException.
You have to do this:
for(int i=0;i < MAXSIZE;i++) objectArr[i] = new Object();
You have to in essence, now allocate memory to every element of the array of objects.
In conclusion, fuck you NullPointerException I'm better than you.
PS: This wasn't in any book, so I thought should post it up.
"I want to kill you.
Take away your life."
Kreator - Murder Fantasies.
0 Responses to NullPointerException
Something to say?