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
Q51: Consider the following code snippet: public static
Q52: To maintain compatibility with pre-generic Java, type
Q53: Which of the following statements about the
Q54: Consider the following code snippet: public static
Q55: Which of the following satisfies the wildcard
Q57: What does it mean when the syntax
Q58: What does the following code snippet mean:
Q59: Consider the following code snippet: public class
Q60: Consider the following code snippet: public static
Q61: Generics limit Java code somewhat. Which of
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents