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