This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes NullPointerException : Accessing or modifying the field of a null object? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "NullPointerException : Accessing or modifying the field of a null object?" Watch "NullPointerException : Accessing or modifying the field of a null object?" New topic
Author

NullPointerException : Accessing or modifying the field of a null object?

Dmitri Makovetskiy
Ranch Hand

Joined: Jun 21, 2010
Posts: 128



i have this method in my class. it checks whether the chess pieces move is valid and brings a boolean answer back.
yes or no.
now. the method calling works fine. what worries me that when i try to substitute the value (an object ) for a null.
does this generate that exception?


Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38045
    
  22
Not quite sure I understand the question. Nor do I understand the code, which appears incomplete: please read this.

Have you tried a null reference to see what happens?
 
Don't get me started about those stupid light bulbs.
 
subject: NullPointerException : Accessing or modifying the field of a null object?
 
Similar Threads
MultiDimensional array doesnt work
How do i improve variable visibility?