Limited access

Upgrade to access all content for this subject

Consider the following string.

String name = "Amanda";

Consider the following code segment.

String sub = name.substring(name.indexOf('m'), name.indexOf(name.substring(name.length()-1)));

What does sub contain after the following code is executed?

A

sub = "manda"

B

sub = "ma"

C

compilation error

D

sub = "mand"

E

sub = "m"

Select an assignment template