Boolean booleanValue() method in Java with examples
Last Updated :
01 Oct, 2018
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:
class GeeksforGeeks {
public static void main(String[] args)
{
Boolean b = new Boolean( true );
boolean value = b.booleanValue();
System.out.println(value);
}
}
|
Example 2:
class GeeksforGeeks {
public static void main(String[] args)
{
Boolean b = new Boolean( false );
boolean value = b.booleanValue();
System.out.println(value);
}
}
|
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...