Boolean | Sololearn: Learn to code for FREE!



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


Boubacar Toure i have no idea what you mean my dude


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


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.