1.
- abcdef
- aabbccddeeff
- abbccddeef
- abcbcdcdedef
- Nothing is printed because an IndexOutOfBoundedsException is thrown.
Q1: Considering the following code segment, what is printed after execution?
String str = "abcdef";
for (int k = 0; k < str.length() - 1; k++)
System.out.print(str.substring(k, k+2));