Page 1 of 1

About Question enthuware.ocajp.i.v7.2.1202 :

Posted: Sun Aug 31, 2014 5:52 pm
by chrisbarrett
I don't have any problem with the question, but I wonder if the Explanation to the Question is accurate:
Following are the default values that instance variables are initialized with if not initialized explicitly:
types (byte, short, char, int, long, float, double) to 0 ( or 0.0 ).
All Object types to null.
boolean to false.
As per the JLS, I thought the default for a char was null (via '\u0000')?

Cheers!
Chris

Re: About Question enthuware.ocajp.i.v7.2.1202 :

Posted: Sun Aug 31, 2014 7:49 pm
by admin
char is a primitive. It cannot be null. The value is 0, which is interpreted as null character.

HTH,
Paul.

Re: About Question enthuware.ocajp.i.v7.2.1202 :

Posted: Tue Sep 02, 2014 12:04 pm
by chrisbarrett
Hi Paul,

Ahhh... Thanks for clarifying!