+ 3
Java default boolean value?
I thought default value for a boolean was false in java. But I can't understand why boolean b = true?true:false returns true...😵
3 ответов
+ 3
there are no value before ini, this return error
boolean b;
System.out.println(b);
Your expression mean
// true ? true :false
if (true) {
return true;
else
return false;
}
so you assign true to b
+ 3
Thanks for your help! I get it now! 👌