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

D) Because the return type of the method is an Object

Computer Science & Information Technology

You might also like to view...

When you copy a file from one location to another and there is already a file with the same name in that folder, you get which of the following choices in a dialog box?

A) Copy and Replace B) create new folder and then copy C) make two copies with the same name in the same folder D) move original file to another folder

Computer Science & Information Technology

The Security tab of a template's Permissions dialog box enables you to configure the template's ACL and define the security rights for enrollment and use of certificates. Which permission specifically enables autoenrollment of user and computer certificates?

a. Read b. Write c. Enroll d. None of the above.

Computer Science & Information Technology