Consider the statement below:
StringBuilder sb1 = new StringBuilder("a toyota") ;
Which of the following creates a String object with the value "toy"?
A) String res = sb1.subString(2,5) ;
B) char dest[] = new char[sb1.length() ];
Sb1) getChars(2,5,dest,0) ;
String res = new String(dest) ;
C) char dest[] = new char[sb1.length];
Dest = sb1.getChars(2,5) ;
String res = new String(dest) ;
D) char dest[] = new char[sb1.length() ];
Dest = sb1.getChars(0,3) ;
String res = new String(dest) ;
Correct Answer:
Verified
Q2: Which of the following creates the string
Q5: Consider the examples below:
A. a string.
B.
Q7: Which of the following is not a
Q8: The statement
S1)equalsIgnoreCase(s4)
Is equivalent to which of the
Q10: Which of the following will create a
Q14: Given the following declaration:
StringBuilder buf =
Q15: StringBuilder objects can be used in place
Q17: Which of the following statements is true?
A)
Q18: String objects are immutable. This means they
Q19: Given the following declarations:
StringBuilder buffer =
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