String s = "abcdef";
String t = s.substring(1, 4).substring(1);
System.out.println(t);What is printed?
- Acheck_circle
cd
- B
bc
- C
bcd
- D
cde
Explanation
s.substring(1, 4) is "bcd"; calling substring(1) on "bcd" gives "cd".
AP Computer Science A· difficulty 4/5
String s = "abcdef";
String t = s.substring(1, 4).substring(1);
System.out.println(t);What is printed?
cd
bc
bcd
cde
Explanation
s.substring(1, 4) is "bcd"; calling substring(1) on "bcd" gives "cd".
Want 10 more like this — adaptive to your weak spots?