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 Toure3 Answers
New Answera 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.
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message