Solved

If the Combo Box AddressBox Contains a List of Strings

Question 54

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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions