# boolean Java Keyword

boolean is a Java primitive type.

A boolean variable may take on one of the values true or false.

## Examples

      boolean valid = true;

      if (valid)
      {
         <statement>
      }

## Remarks

- A boolean variable may only take on the values true or false. A boolean may not be converted to or from any numeric type.

- Expressions containing boolean operands can contain only boolean operands.

- The Boolean class is a wrapper class for the boolean primitive type.

Related Topics

false Java Keyword

true Java Keyword