Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Booelan and null

 
Madulika Reddy
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The field is declared as Booelean. How can we check if we have null in this field.

Regards,
Madhulika
 
Paul Bourdeaux
Ranch Hand
Posts: 783
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this a servlet question or a general java one? If it is general java, you should post it in the appropriate forum. If it has something to do with servlets, I am having trouble understanding your question. What field? An attribute? A parameter? Please be more specific so we can help.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Java in General (beginner)
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Tom Blough
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it is Boolean, the Object wrapper for the boolean type, then you can test for null the same way you test any other Java object for null as a previous poster already pointed out.

If it is boolean, then it is a primitive type that can contain only the values True or False. It cannot be null.

Cheers,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic