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.
Gautham Muralidharan wrote:
The output for the above code snippet is a NullPointerException.
But it was mentioned that the answer is null in the webpage where I found the question.
Which is the correct output?