I am trying to input an int into the end of a singly linked list. I have already created the code to put a number at the end of the list but when I go to print it out, it only prints out (in my test class) the int that will go at the end of the list rather than printing out the whole list(and then .
mylist.addEnd(8);
System.out.println("after addEnd");
anIterator = mylist.iterator(); // reads mylist collection
for (int i=0;i<mylist.getSize();i++)
System.out.print(anIterator.next() + " ");
If this seems correct then something must be wrong with my addEnd method.