Page 1 of 1

About Question enthuware.ocajp.i.v8.2.1444 :

Posted: Sat Dec 31, 2016 10:07 pm
by Deleted User 3513
Hi,

I would like to clarify the choice:

return new StringBuilder("xxxx").insert(0, fullPhoneNumber, 0, 8).toString();

From my understanding, I have a StringBuilder("xxxx"). Then, I insert the contents of fullPhoneNumber(from index 0 to 7) at the index 0 of the StringBuilder("xxxx")?

Thanks in advance!

Re: About Question enthuware.ocajp.i.v8.2.1444 :

Posted: Sat Dec 31, 2016 11:33 pm
by admin
Yes, that is correct. But always refer to the official JavaDoc for confirmation:
https://docs.oracle.com/javase/8/docs/a ... A-int-int-

and of course, run a test program to do a practical :)