java.lang.Boolean booleanValue()

Description

The booleanValue() method of Boolean class is use to get the primitive equivalent of this Boolean object. This method will yield the same result if you use the unboxing concept of java. Let’s say we have declared Boolean value = true then both of the following statement will yield the same result and The unboxing feature of java will take care of the conversion of Boolean object to its primitive data type.

Method Syntax

public boolean booleanValue()

Method Argument

Data Type Parameter Description
N/A N/A N/A

Method Returns

The booleanValue() method of Boolean class returns the primitive boolean value of this object.

Java Boolean booleanValue() Example

Below is a simple java example on the usage of booleanValue() method of Boolean class.

Sample Output

The following is the sample output if you run the sample code:

java Boolean booleanValue() example output