Limited access

Upgrade to access all content for this subject

Which of the following expressions places the last two characters of String str at the beginning of the string and then appends the rest of the string?

A

String new = str.length() - 2 + str;

B

String new = str.substring(str.length() - 2) + str;

C

String new = str.substring(str.length() - 2) + str.substring(0, str.length() - 2);

D

String new = str.substring(str.length() - 2) + str.substring(0, str.length());

E

String new = str.substring(str.length() - 2, 2) + str.substring(0, str.length());

Select an assignment template