by Dinesh Thakur

This Java boolean Variable Example shows how to use Java boolean variable inside a java class. The boolean data type which can have only two values, true or false.


Here is the Java Example for the program JavaBooleanVariableExample :

public class JavaBooleanVariableExample

{
     public static void main(String[] args)
     {
     boolean bool = (22 > 4)? true:false;
     System.out.println("Value of bool (22 > 4)? :" + bool);
   }
}

Java boolean Variable Example