Get your CodeRanch badge!*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 36453
    
  15
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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NullPointerException : Accessing or modifying the field of a null object?
 
Similar Threads
How do i improve variable visibility?
MultiDimensional array doesnt work