Solved

Determine the Correctness of the MyLinkedList Generic Class Code Below

Question 54

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) MyNode cannot refer to type variable E
B) first.data will cause a compiler error
C) the inner class MyNode cannot be private
D) the code is correct

Correct Answer:

verifed

Verified

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

Related Questions