Multiple Choice
Determine the correctness of the MyLinkedList generic class code below.
public class MyLinkedList<E>
{
private MyNode first;
public E getFirst() { return first.data; }
private class MyNode
{
private E data;
private MyNode next;
}
}
A) the inner class MyNode cannot be private
B) MyNode cannot refer to type variable E
C) first.data will cause a compiler error
D) the code is correct
Correct Answer:

Verified
Correct Answer:
Verified
Q11: Consider the following code snippet:<br>public class Box<E><br>{<br>private
Q12: Suppose a linked-list class called MyLinkedList with
Q13: Which of the following satisfies the wildcard
Q14: Consider the following code snippet:<br>public class Box<E><br>{<br>private
Q15: Which of the following statements about generic
Q17: If a class requires two generic type
Q18: What does it mean when the syntax
Q19: Which of the following satisfies the wildcard
Q20: Which of the following statements about generic
Q21: Which of these Java library classes are