Vince Tan wrote:So when you say a default value (for objects or enum) in this case you're referring to null? And local variable (objects or enum) don't even get a null value assigned? Is that right?
Yes!
For class and instance variables: default values for everyone! A reference variable (no matter which type) will get
null as default value; a primitive variable will get an appropriate default value depending on the primitive type (e.g.
false for
boolean,
0 for
int,...).
For local variables: default values for no one! (that is: no default values at all)