on ‎2009 May 14 8:16 AM
Hi All,
Can Any one tell me abt java.lang.NullPointerException.
when we will get this type of error and how to solve this.
if we get this error where we have to check the error.
Request clarification before answering.
Hi there,
Null pointer exception is normally gotten when you forgot to initialise a variable. Even for object itself, it could be pointing to no where because you did not initialise any valid object to it. Eg, the Ball object has a Color attribute, but because you did not set anything for it and when you TRY to use getColor, it will throw a null pointer exception because it got nothing, not even a "" (space) is set.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.