Question & Answer: What will be the value of str after the following statements are executed? StringBuilder str = new stringBuilder ("We have lived i…..

Question 12 What will be the value of str after the following statements are executed? StringBuilder str new stringBuilder (We have lived in Chicago,+ Trenton, and Atlanta.) str.replace (17, 24,Tampa) O We have lived in Tampa, Trenton, and Atlanta We have lived in Chicago, Tampa, and Atlanta We have lived in Chicago, Trenton, and Tampa We have lived in Chicago. Tampaon, and Atlanta Question 13 Which of the following is true about protected access? Protected members may be accessed by methods in the same package or in a subclass, but only if the subclass is in the same package Protected members cannot be accessed by methods in any other classes Protected members may be accessed by methods in the same package or in a subclass, even when the subclass is in a different package Protected members are actually named constant:s Question 14 In the following statement, which is the subclass? public class classa extends ClassB implements classc O classA ClassB O Classo Cannot tell Question 15 An ArrayList object automatically expands in size to accommodate the items stored in it True False Question 16 In the following statement, which is the interface? public class ClassA extends ClassB implements Classc ClassiA ClassB Classoc Cannot tell Question 17 If panel references a JPanel object, which of the following statements adds the GridLayout to it? ● panel .addLayout (new GridLayout (2, 3) ) ; O panel.attachLayout (GridLayout (2,3))i panel . setLayout (new GridLayout (2,3)) ; O panel.GridLayout (2, 3)

What will be the value of str after the following statements are executed? StringBuilder str = new stringBuilder (“We have lived in Chicago,”+ ” Trenton, and Atlanta.”) str.replace (17, 24,”Tampa”): We have lived in Tampa, Trenton, and Atlanta. We have lived in Chicago, Tampa, and Atlanta. We have lived in Chicago, Trenton, and Atlanta. We have lived in Chicago, Tampaon, and Atlanta. Which of the following is true about protected access? Protected members may be accessed by methods in the same package or in a subclass, but only if the subclass is in the same package. Protected members cannot be accessed by methods in any other classes. Protected members may be accessed by methods in the same package or in a subclass, even when the subclass is in a different package. Protected members are actually named constant. In the following statement, which is the subclass? public class classA extends ClassB implements classC classA ClassB ClassC Cannot tell An ArrayList object automatically expands in size to accommodate the items stored in it. True False In the following statement, which is the interface? public class ClassA extends ClassB implements ClassC ClassA ClassB ClassC Cannot tell If panel references a JPanel object, which of the following statements adds the GridLayout to it? panel.addLayout (new GridLayout (2, 3)): panel.attachLayout (GridLayout (2, 3)): panel.setLayout (new GridLayout (2, 3)): panel.GridLayout (2, 3);

Expert Answer

 

Don't use plagiarized sources. Get Your Custom Essay on
Question & Answer: What will be the value of str after the following statements are executed? StringBuilder str = new stringBuilder ("We have lived i…..
GET AN ESSAY WRITTEN FOR YOU FROM AS LOW AS $13/PAGE
Order Essay

1) It will replace the substring from index 17 which is Chicago and put Tampa in place of it so result will be We have lived in Tampa, Trenton, and Atlanta.

2) Protected members may be accessed by methods in same package or in a subclass but only if the subclass is in the same package.

3) Here Class A is the subclass as it is extending Class B which is superclass.

4) Yes Arraylist is dynamic which automatically in size to accommodate the items stored in it.

5) Class C is the interface as this is being implemented by class A.

6) panel.setLayout(new GridLayout(2,3));

Still stressed from student homework?
Get quality assistance from academic writers!