Limited access

Upgrade to access all content for this subject

Consider the following code segment.

String s ="goodbye";
System.out.println(s.substring(s.substring(s.length() – s.indexOf("d")).length()));

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

A

bye

B

3

C

dbye

D

2

E

odbye

Select an assignment template