Question: Consider the following code segment. String str = abcdef; for (int rep = 0; rep < str.length() - 1; rep++) { System.out.println (str.substring(rep, rep +
Consider the following code segment.
String str = "abcdef"; for (int rep = 0; rep < str.length() - 1; rep++) { System.out.println (str.substring(rep, rep + 2)); }
What is printed as a result of executing this code segment?
Question 13 options:
| |||
| |||
| |||
| |||
|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
