<code>"hi".charAt(2)</code> causes
- A
Returns 'i'
- Bcheck_circle
Throws StringIndexOutOfBoundsException
- C
Returns -1
- D
Returns null character
Explanation
Valid indices: 0..length-1 = 0..1; index 2 is out of bounds.
AP Computer Science A· difficulty 3/5
<code>"hi".charAt(2)</code> causes
Returns 'i'
Throws StringIndexOutOfBoundsException
Returns -1
Returns null character
Explanation
Valid indices: 0..length-1 = 0..1; index 2 is out of bounds.
Want 10 more like this — adaptive to your weak spots?