Posts Tagged Data types

Java – Boolean Example

Sunday, August 9th, 2009

Boolean is data type in java which either true or false value. This value can be 0 or 1 form. Use of Boolean in java is shown below.

Example of Boolean

public class BooleanExample {

    public static void main(String[] args) {

        boolean booleanType=false;

        if(booleanType==false)
        {
            System.out.println("boolean example data type value :"+booleanType);
        }
    }
}

Output

boolean example data type value :false