Multiple Choice
If the combo box addressBox contains a list of strings, why is the returned value of getSelectedItem method in the following code cast to String?
String selectedAddress;
SelectedAddress = (String) addressBox.getSelectedItem() ;
A) This is not necessary.
B) Because the syntax of the method requires it
C) It makes the program more readable.
D) Because the return type of the method is an Object
Correct Answer:

Verified
Correct Answer:
Verified
Q48: The getSelectedIndex method returns:<br>A) the index of
Q49: Images may be displayed in labels and:<br>A)
Q50: By default the scroll bars are always
Q51: To add the JList object addressList to
Q52: Which of the following statements creates a
Q53: If addressList exists and has values stored
Q55: When an item in the combo box
Q56: A menu within a menu is called
Q57: A label's preferred size is determined only
Q58: The ImageIcon class constructor accepts:<br>A) an integer