Multiple Choice
Insert the missing code in the following code fragment. This fragment is intended to remove a node from the head of a linked list:
Public class LinkedList
{
) . .
Public Object removeFirst()
{
If (first == null) { ________________ }
Object element = first.data;
First = first.next; 1
Return element;
}
) . .
}
A) throw new NoSuchElementException() ;
B) throw new IllegalStateException() ;
C) throw new NullPointerException() ;
D) throw new IllegalArgumentException() ;
Correct Answer:

Verified
Correct Answer:
Verified
Q21: Consider the following code snippet: LinkedList<String> words
Q25: Assume that the linked list implementation includes
Q34: In the textbook implementation, the Node class
Q48: Elements in a hash table are said
Q51: Which of the following actions must be
Q51: Assume that you have a hash table
Q67: Insert the missing code in the following
Q81: Using the textbook's implementation of a linked
Q86: What feature of the ArrayList class makes
Q94: Which of the following statements about hash