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:
Verified
Q11: Given the following declarations:
StringBuilder buf;
StringBuilder buf2
Q13: Consider the statements below:
StringBuilder sb =
Q15: An anonymous String _.
A)has no value
B)is a
Q16: How many String objects are instantiated by
Q17: The length of a string can be
Q18: The statement
S1)startsWith("art")
Has the same result as which
Q20: The String method substring returns _.
A)a char
B)a
Q21: Which of the following statements is true?
A)
Q22: Consider the Java segment:
String line1 =
Q26: Consider the Java segment:
String line1 =
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents