String s = "hello";
char c = s.charAt(1);
System.out.println(c);What is printed?
- A
l
- Bcheck_circle
e
- C
1
- D
h
Explanation
Indexing is zero-based; the character at index 1 of "hello" is 'e'.
AP Computer Science A· difficulty 2/5
String s = "hello";
char c = s.charAt(1);
System.out.println(c);What is printed?
l
e
1
h
Explanation
Indexing is zero-based; the character at index 1 of "hello" is 'e'.
Want 10 more like this — adaptive to your weak spots?