I have an assignment that I can't get. I've narrowed it down to one method that's causing the problem, so any guidance would be fantastic.
It's suppose to take the value entered and add a new node at the end of my node list. I'm suppose to create a node list of numbers 1-20, but only the number 1 is added. The size of my node list is also only one so I know that it is not a printing out of the information issue.
public void addLast(Object value)
if (first == null)
first = new ListNode(value, null);
last = first;
last = new ListNode(value, null);
I've attached the rest of my code.
This is for the JavaAB test so I'm basicly on my own to learn it, so I have a few another question about list nodes while I'm at it. Why are they useful? It seems that using an Array or arraylist would accomplish the same task.