Multiple Choice
Is the code snippet written below legal? (lines are numbered for reference)
A) Yes.
B) No; there should be a semicolon at the end of line 2.
C) No; for i = 4, s.substring(i, i + 1) will result in an StringIndexOutOfBounds error.
D) No; line 4 should have no semicolon at the end.
Correct Answer:

Verified
Correct Answer:
Verified
Related Questions
Q66: What is the output of the following
Q67: What is the output of the following
Q68: How many times does the following loop
Q69: What is the first and last value
Q70: What is the output of the code
Q72: Which of the following for loops is
Q73: What is the output of this loop?
Q74: What is the output of this code
Q75: What values does counter variable i take
Q76: What is the output of the code