Solved

Consider the Following Code Snippet in the LinkedList<E> Class: Public

Question 18

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:

verifed

Verified

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

Related Questions