Example
A boolean data type with true or false values:
java
boolean isJavaFun = true;
boolean isFishTasty = false;
System.out.println(isJavaFun); // Outputs true
System.out.println(isFishTasty); // Outputs false
Definition and Usage
The boolean keyword is a data type that can only take the values true or false.
Boolean values are mostly used for conditional testing (read the Java Booleans Tutorial for more information).