Java – Boolean Example

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

Tags:

Bookmark  

 

One Response to “Java – Boolean Example”

  1. DeAndrea says:

    When using the boolean can you interchange the loop at the end so the boolean can keep being used at the end of the String?

Leave a Reply

Security Code:

 

  Random Post