Java boolean default value

In this post, we will see what is default value of boolean and Boolean in java.

💡 Did you know?

The Default value of boolean is false and wrapper class Boolean is null.

Here is the example to demonstrate the same.

Output:

Default value of boolean: false
Default value of Boolean(Wrapper): null

As you can see default value of boolean is false and Boolean is null.

That’s all about Java boolean default value.

Was this post helpful?

Leave a Reply

Your email address will not be published. Required fields are marked *