File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Murach's Java Servlets and JSP this week in the Servlets 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: 37874
    
  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
How do i improve variable visibility?
MultiDimensional array doesnt work