The boolean Keyword

The boolean Keyword in java avails one of the two values that are true and false.

The boolean Keyword

The boolean Keyword

     

The boolean Keyword in java avails one of the two values that are true and false.

Java have the boolean type so literal values true and false. 

The boolean is a Java primitive type. 

The default value for boolean field is false.

Syntact: 

boolean valid = true;
if (valid)
{
<statement>
}