Page 1 of 1

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

Posted: Sun Jul 21, 2013 12:07 am
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

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

Posted: Sat Jan 18, 2025 3:52 pm
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!