Solved

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

Question 57

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

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents