Java-Boolean

Boolean

Boolean type is used when we want to test a particular condition during the execution of the program. There are only two values that a boolean type can take : true or false. Boolean type is denoted by the keyword boolean.

Program

1

Program Source

class Javaapp {

    public static void main(String[] args) {
        
        boolean bo = false;
        System.out.println("bo = "+bo);
        bo = true;
        System.out.println("bo = "+bo);
    }
}

Leave a Comment