This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile 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