• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to test for null?  RSS feed

 
Anu satya
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have got a doubt about null pointing object / instance test.

In general practice, how do a good programmer test for null values?

is it like :


OR is there any other method to test for null in java? like JUnit or "Sahi" kind of testing tool?

Please help me
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's very close from what you have written.

"a" and "null" can be on either side of the operator.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!