I cannot figuare out what is wrong with this, I am getting null pointer errors pointing to my while loop but I don't know what the deal is. This is a doubly linked list, next and previous are set to null when a new link is created and all the accessor functions work fine, so...
I think the problem might here in the getNext() method since if the next is null then you can return it and when you try to return it might give a NullPointerException. Why don't you check whether the next is Null before returning and then return a valid object...???
Hey Jake, consider what happens when head is null... Your head variable gets assigned to the Link but temp is still null. Then when you hit the while loop your asking to call a method on null (temp).