Can anyone tell me why the method below is giving me this compiler error:
C:\CS46B\OurLinkedList\OurLinkedList.jav
a:232: cannot resolve symbol
symbol : class NoSuchElementException
location: class OurLinkedList
throw new NoSuchElementException();
public Object removeFirst()
{
if (first == null) // empty list
throw new NoSuchElementException();
else
{
Object heldData = first.data;
first = first.next;
return heldData;
}
}