by Dinesh Thakur Category: Data Type

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

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.



Search Content