Daniel Lobo wrote:Hi all,
I found an error in Mala Gupta's OCA Java SE8 (page 238).
See page 238:
In the preceding code, the call to lang1.substring() and lang2.subtring() will return "Ja".
The call to lang1.substring() and lang2.subtring() will return "J" instead of "Ja" because the substring method doesn't include the character at the end position (1) so only the position 0 ("J") will be returned.
Hi Daniel -
Thanks for posting it.
You are correct. lang1.substring(0,1) returns 'J'.
A lot of folks ask me - how is it that simple errors like these aren't noticed during the content review cycles.
My response - You can compare books with software. Perhaps an open bug on the system is due to changes in the code that fixed a bug in its last cycle. :-)
I've added it the book's errata. I'll post the link to the errata soon.
Thanks again.
With much respect,
Mala