The correct answer is the letter C, String is immutable, that is, it is necessary to create a new variable, in the line "myStr.trim();" as no variables are assigned, the line is almost forgotten because it compiles. As java indexes from 0 it prints 5 which is the C answer.
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
Highly Voted 9 months, 3 weeks agoVicky_65
Most Recent 3 months, 2 weeks agoakbiyik
7 months, 2 weeks agoalex_au
9 months, 3 weeks agoshivkumarx
10 months, 1 week agoshivkumarx
10 months, 1 week agoiSnover
9 months, 3 weeks ago