About Question com.enthuware.ets.scjp.v6.2.268 :
Posted: Tue Feb 14, 2012 6:23 pm
Hi,
The correct answer saying "This questions tests your knowledge on the default values of uninitialized primitives and object references, . booleans are initialized to false, numeric types to 0 and object references to null. "
However, in real java compiler, it shows compiler error when you trying to use a uninitialized boolean, so I doubt the correctness of this explain.
//compile error
boolean b;
if(b){
}
The correct answer saying "This questions tests your knowledge on the default values of uninitialized primitives and object references, . booleans are initialized to false, numeric types to 0 and object references to null. "
However, in real java compiler, it shows compiler error when you trying to use a uninitialized boolean, so I doubt the correctness of this explain.
//compile error
boolean b;
if(b){
}