Top.Mail.Ru
October 4th, 2002 - Java developers — LiveJournal
? ?

Java developers

October 4th, 2002
Image

10:15 pm - Imagemarauder65ix

Can anyone tell me why the method below is giving me this compiler error:

C:\CS46B\OurLinkedList\OurLinkedList.java: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;
		}
	}
Powered by LiveJournal.com
Image