A boolean value can only be defined as true or false. public class MainClass{ public static void main(String[] argv){ boolean t = true; // Legal boolean f = 0; // Compiler error! System.out.println(); } }
Type mismatch: cannot convert from int to boolean