AP® Computer Science A

Free Version

Upgrade subject to access all content

Moderate

Length, UpperCase and LowerCase methods

APCSA-7JEE7U

Consider the following code.

 String a = "poppop";
 String b = "corn";
 String c = a.substring(0, a.length()/2).toUpperCase() + b.toUpperCase() + a.substring(a.length()/2).toUpperCase();

Which of the following represents the value of c?

A

POPCORNPOP

B

POPCORN

C

popcornpop

D

poppopcorn

E

POPCORNP