What's the difference between boolean and Boolean in Java?

roundcrisis picture roundcrisis · Aug 18, 2009 · Viewed 79.2k times · Source

I would like to understand the difference between the Boolean and boolean types in Java, specifically as they relate to GWT. I know that methods are not supported but I want more info if it is available.

Answer

rustyshelf picture rustyshelf · Aug 19, 2009

It's fairly Simple and the same for GWT and Java:

  • boolean can be yes or no
  • Boolean can be yes, no or NULL.

So unless you need the NULL (like for example your loading the field from the database, and you want NULL to be different to false) then stick to boolean.