Boolean booleanValue() method in Java with examples Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report The booleanValue() method of Boolean Class is a built in method in java which is used to return the primitive boolean value of instance which is used to call the method booleanValue(). Syntax BooleanObject.booleanValue() Return Value: It returns a primitive boolean value. Below are the examples to illustrate booleanValue() method: Program 1: JAVA class GeeksforGeeks { // Driver method public static void main(String[] args) { // creating a Boolean object. Boolean b = new Boolean(true); // get primitive data type using booleanValue() boolean value = b.booleanValue(); // Print the result System.out.println(value); } } Output: true Example 2: JAVA class GeeksforGeeks { // Driver method public static void main(String[] args) { // creating a Boolean object. Boolean b = new Boolean(false); // get primitive data type using booleanValue() boolean value = b.booleanValue(); // Print the result System.out.println(value); } } Output: false Comment More infoAdvertise with us Next Article Boolean compare() method in Java with Examples S ShivamKD Follow Improve Article Tags : Java Java - util package Java-Functions Practice Tags : Java Similar Reads Boolean equals() method in Java with examples The equals() method of Boolean class is a built in method of Java which is used check equality of two Boolean object. Syntax: BooleanObject.equals(Object ob) Parameter: It take a parameter ob of type Object as input which is the instance to be compared. Return Type: The return type is boolean. It re 2 min read Boolean equals() method in Java with examples The equals() method of Boolean class is a built in method of Java which is used check equality of two Boolean object. Syntax: BooleanObject.equals(Object ob) Parameter: It take a parameter ob of type Object as input which is the instance to be compared. Return Type: The return type is boolean. It re 2 min read Boolean compare() method in Java with Examples The compare() method of Boolean class is a built in method in Java which is used to compare two boolean values. It is a static method, so it can be called without creating any object of the Boolean class i.e. directly using the class name. Syntax: Boolean.compare(boolean a, boolean b) Parameters: It 2 min read Boolean compare() method in Java with Examples The compare() method of Boolean class is a built in method in Java which is used to compare two boolean values. It is a static method, so it can be called without creating any object of the Boolean class i.e. directly using the class name. Syntax: Boolean.compare(boolean a, boolean b) Parameters: It 2 min read Boolean compareTo() method in Java with examples The compareTo() method of Boolean class is a built in method in Java which is used to compare the given Boolean instance with the current instance. Syntax: BooleanObject.compareTo(Boolean a) Parameters: It takes a Boolean value a as parameter which is to be compared with the current instance. Return 2 min read Boolean compareTo() method in Java with examples The compareTo() method of Boolean class is a built in method in Java which is used to compare the given Boolean instance with the current instance. Syntax: BooleanObject.compareTo(Boolean a) Parameters: It takes a Boolean value a as parameter which is to be compared with the current instance. Return 2 min read Like