A boolean value can only be defined as true or false.
publicclass MainClass{
publicstaticvoid main(String[] argv){
boolean t = true; // Legal
boolean f = 0; // Compiler error!
System.out.println();
}
}
Type mismatch: cannot convert from int to boolean
1.12.boolean
1.12.1.
Boolean literals are the source code representation for boolean values.