Solved

Determine the Correctness of the MyLinkedList Generic Class Code Below

Question 16

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:

verifed

Verified

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

Related Questions