Multiple Choice
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
Correct Answer:
Verified
Q1: Given the following declaration: <br>StringBuilder buf =
Q3: Consider the Java segment: <br>String line1 =
Q4: Which of the following statements is true?<br>A)
Q5: The length of a string can be
Q5: Which of the following are static Character
Q12: Which class is not a type-wrapper class?<br>A)
Q14: The String method substring returns _.<br>A)a char<br>B)a
Q15: Consider the Java segment: <br>String line1 =
Q15: How many String objects are instantiated by
Q22: Consider the Java segment: <br>String line1 =