How to Create a Boolean Type in Java


In this example we will show you how to create a boolean type in Java.

Source Code

package com.beginner.examples;

public class BoolenType {
  public static void main(String[] args) {
    boolean isBoy = true; // boolean
    boolean isGirl = false; // boolean
    System.out.println(isBoy);
    System.out.println(isGirl);
  }
}

Output:

true
false
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments