?

AP® Computer Science A

Free Version

Upgrade subject to access all content

Easy

String substring and indexOf Methods

APCSA-4TXYVT

Consider the following code.

String s = "I hope the operation goes well";
System.out.println(s.substring(s.indexOf("op")+4));

What is printed as a result of executing the code segment?

A
operation goes well
B
15
C
ation goes well
D
7
E
the operation goes well