Hi I'm very new to Java and trying to create a Deque class by implementing a doubly linked-list format. When I run the code(DequeApp), I get a NullPointerException refer back to my Iterator.next(Deque.java:44).
Error messages: **Exception in thread "main" java.lang.NullPointerException
at dlist.Deque$DoubleListIterator.next(Deque.java:44)
public E next() {
if (!hasNext()) {throw new NoSuchElementException();}
else{
E temp = current.item;
current = current.next;
return temp;}
}