Solved

Consider the String Below

Question 24

Multiple Choice

Consider the String below:
String r = "a toyota";
Which of the following will create the String r1 = "a TOYOTa"?


A) String r1 = r.replace("toyot", TOYOT") ;
B) String r1 = r.replace('t','T') ;
r1 = r.replace('o','0') ;
r1 = r.replace('y','Y') ;
C) String r1 = r.replace('t','T') .replace('o', '0') .replace('y', 'Y') ;
D) String r1 = r.substring(2, 4) .toUpperCase() ;

Correct Answer:

verifed

Verified

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

Related Questions