The answer is the letter D, the String "Thomas" passes normally but the String "Peter" does not have position 6, this catches the exception and throws it on the "Invalid name" screen.
NOTE: When counting the size of a String, the indexing does not start from 0, for example the String "date" has 4 substrings inside it instead of 3 if it was indexed from 0, this is the only case that does not start from 0 for the OCA exam, always stay tuned.
upvoted 1 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
iSnover
3 months, 1 week ago