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

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
chrisbarrett
Posts: 5
Joined: Sun Aug 31, 2014 5:44 pm
Contact:

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

Post 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

admin
Site Admin
Posts: 9116
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

char is a primitive. It cannot be null. The value is 0, which is interpreted as null character.

HTH,
Paul.
If you like our products and services, please help us by posting your review here.

chrisbarrett
Posts: 5
Joined: Sun Aug 31, 2014 5:44 pm
Contact:

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

Post by chrisbarrett »

Hi Paul,

Ahhh... Thanks for clarifying!

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 4 guests