Multiple Choice
Suppose a linked-list class with a generic E type has been constructed with a java.awt.Component type variable. Consider its instance method locate with the following header: public void locate(MyLinkedList<? extends E>) { . . . }
Which type cannot be passed to method locate?
I MyLinkedList<JButton>
II MyLinkedList<Component>
III MyLinkedList<JTextField>
A) I
B) I and II
C) II and III
D) all can be passed to locate
Correct Answer:

Verified
Correct Answer:
Verified
Q25: Which of the following statements about using
Q26: Consider the following code snippet: public class
Q27: Consider the following code snippet: public class
Q28: Consider our own generic class MyLinkedList shown
Q29: Given the following generic method, which of
Q31: Consider the following class declaration: public class
Q32: Suppose a generic method accepts a generic
Q33: Which Java generic programming technique(s) requires the
Q34: Consider the following code snippet: ArrayList<BankAccount> accounts1
Q35: Consider the following code snippet: public class