Multiple Choice
Consider the following code snippet in the LinkedList<E> class:
Public void addAll(LinkedList<? extends E> other)
{
ListIterator<E> iter = other.listIterator() ;
While (iter.hasNext() )
{
Add(iter.next() ) ;
}
}
Which of the following statements about this code is correct?
A) You must supply a specific type for the element type of other.
B) For the element type of other, you must supply a type that is a subtype of E.
C) For the element type of other, you must supply a type that is a supertype of E.
D) For the element type of other, you must supply a type that is either a subtype or a supertype of E.
Correct Answer:

Verified
Correct Answer:
Verified
Q25: Which of the following statements about using
Q34: Consider the following code snippet: ArrayList<BankAccount> accounts1
Q55: Which of the following statements about generic
Q69: Consider the following code snippet:<br>Public static <E
Q69: Erasure of types limits Java code somewhat
Q70: Consider the following code snippet:<br>Public static <E>
Q73: Which is the purpose of the <E>
Q74: Consider the following code snippet:<br>Public static void
Q76: Given the following generic method, which of
Q78: Suppose a linked-list class with a generic