About Question com.enthuware.ets.scjp.v6.2.601 :

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

Moderator: admin

Post Reply
javatek202
Posts: 8
Joined: Tue May 14, 2013 12:27 am
Contact:

About Question com.enthuware.ets.scjp.v6.2.601 :

Post by javatek202 »

Hi,
This is a side question about the String() class.
Do you know why the API doc says that the constructor String() is not needed because String is immutable:
public String()
Initializes a newly created String object so that it represents an empty character sequence. Note that use of this constructor is unnecessary since Strings are immutable.
Thanks

dameest
Posts: 13
Joined: Sat Nov 30, 2024 5:27 am
Contact:

Re: About Question com.enthuware.ets.scjp.v6.2.601 :

Post by dameest »

For sure I learnt something very important through all of this: Always read the questions carefully... I read "this code will compile" and missed the "not". It is not the first time, and easy to miss after an hour or so in a test... LOL!

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests