Solved

Consider the String Below

Question 4

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

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents