What are the default values of boolean
(primitive) and Boolean
(primitive wrapper) in Java?
The default value of Boolean is False . Boolean values are not stored as numbers, and the stored values are not intended to be equivalent to numbers. You should never write code that relies on equivalent numeric values for True and False .
A Boolean expression is a Java expression that returns a Boolean value: true or false .
The default value for a Boolean
(object) is null
.
The default value for a boolean
(primitive) is false
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With