public class LinkedList<E>
{
. . .
publicEremoveFirst()
{
if (first == null)
throw new NoSuchElementException();
Eelement = first.data;
first = first.next;
return element;
}
. . .
private Node first;
private class Node
{
publicEdata;
public Node next;
}
}