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
3 Réponses
+ 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.