Question: Consider the statement below: StringBuilder sb1 = new StringBuilder(a toyota); Which of the following creates a String object with the value toy? Group of answer

Consider the statement below: StringBuilder sb1 = new StringBuilder("a toyota"); Which of the following creates a String object with the value "toy"? Group of answer choices String res = sb1.substring(2, 5); char dest[] = new char[sb1.length()-5]; sb1.getChars(2, 5, dest, 0); String res = new String(dest); char dest[] = new char[sb1.length]; dest = sb1.getChars(2, 5); String res = new String(dest); char dest[] = new char[sb1.length()]; dest = sb1.getChars(0, 3); String res = new String(dest); Both A and B above. Both C and D above

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!