Boolean | Sololearn: Learn to code for FREE!

0

Boolean

Boolean b; System.out.print(b); The result is error, why? By default b is false, so why doesn't it give false as output? A little bit confused

8/27/2019 4:45:42 PM

Boubacar Toure

3 Answers

New Answer

+1

Boubacar Toure i have no idea what you mean my dude

0

a boolean is not false by default, it nothing, not true not false. so type Boolean b = false; System.out.println(b);

0

Cat Sauce, Here is the answer to my question. The default value for a Boolean (object) is null. The default value for a boolean (primitive) is false.