Mega Code Archive

 
Categories / Java Tutorial / Data Type
 

Java boolean value

public class Main {   public static void main(String[] args) {     boolean b1 = true;     boolean b2 = false;     boolean b3 = (10 > 2) ? true : false;     System.out.println("Value of boolean variable b1 is :" + b1);     System.out.println("Value of boolean variable b2 is :" + b2);     System.out.println("Value of boolean variable b3 is :" + b3);   } } /* Value of boolean variable b1 is :true Value of boolean variable b2 is :false Value of boolean variable b3 is :true */