Solved

Assume the Following Variable Has Been Declared and Given Values

Question 7

Multiple Choice

Assume the following variable has been declared and given values as shown:
String name = "Mamey, Jean";
Which statement will print the name as "Jean Mamey"?


A) System.out.print(name.substring(7) + " " + name.substring(0, 5) ) ;
B) System.out.print(name.substring(8, 4) + " " + name.substring(1, 5) ) ;
C) System.out.print(name.substring(8) + " " + name.substring(1, 4) ) ;
D) System.out.print(name.substring(2) + " " + name.substring(1) ) ;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions