String s = "abcdef";
System.out.println(s.indexOf("xyz"));What is printed?
- Acheck_circle
-1
- B
6
- C
0
- D
null
Explanation
indexOf returns -1 when the searched substring is not found.
AP Computer Science A· difficulty 3/5
String s = "abcdef";
System.out.println(s.indexOf("xyz"));What is printed?
-1
6
0
null
Explanation
indexOf returns -1 when the searched substring is not found.
Want 10 more like this — adaptive to your weak spots?