Question & Answer: The getselectedIndex method returns -1 if no item is selected the index of the selected…..

Question 6 The getselectedIndex method returns 1 if no item is selected o the index of the selected itenm Both A and B O Neither A nor B Question 7 What is Polymorphism? Path: p Words:0 Question 8 Assuming that str is declared as follows, String str = RsTUVWXYZ; what value will be returned from str.charAt (5)? Question 9 Every class has a tostring method and an equals method inherited from the object class. O True O False Question 10 The following statement creates an ArrayList object. What is the purpose of the <String> notation? ArrayList<String> arr = new ArrayList<String> (); O It specifies that only string objects may be stored in the ArrayList object O It specifies that the get method will return only string objects O It specifies that string objects may not be stored in the ArrayList object. O It specifies that everything stored in the ArrayList object will be converted to a string Question 11 A subclass class can directly access O only public and private members of the superclass class o all members of the superclass class only public and protected members of the superclass class

The getselectedIndex method returns -1 if no item is selected the index of the selected item Both A and B Neither A nor B What is Polymorphism? Assuming that str is declared as follows, String str = “RsTUVWXYZ”: what value will be returned from str.charAt (5)? U V X W Every class has a tostring method and an equals method inherited from the object class. True False The following statement creates an ArrayList object. What is the purpose of the notation? ArrayList arr = new ArrayList (): It specifies that only string objects may be stored in the ArrayList object. It specifies that the get method will return only string objects. It specifies that string objects may not be stored in the ArrayList object. It specifies that everything stored in the ArrayList object will be converted to a String. A subclass class can directly access only public and private members of the superclass class all members of the superclass class only public and protected members of the superclass class

Expert Answer

 

Don't use plagiarized sources. Get Your Custom Essay on
Question & Answer: The getselectedIndex method returns -1 if no item is selected the index of the selected…..
GET AN ESSAY WRITTEN FOR YOU FROM AS LOW AS $13/PAGE
Order Essay

Given below are the answers for the question. Please do rate the answer if it helped. Thank you.

Question 6) option C – both A and B . i.e. returns -1 when no item is selected and index when an item is selected

Question 7) Polymorphism is the ability of an object to take many forms. It is implemented as inheritance where a
parent class can be used to reference a subclass. The derived class override the parent methods to give different behaviour
in subclass.

Question 8) option D – W . str = “RSTUVWXYZ” and str.charAt(5) refers to element at index 5 (index starts from 0 for 1st character)

Question 9) True – Every object inherits equals and toString () from Object class

Question 10)Option A – Only String objects can be stored in the ArrayList object

Question 11)Option C – a subclass can access only public and protected members of superclass

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