For some reason my LinkedList addObj() method is adding the first object in the list twice -
for reason linkedlist addobj() method adding first object in list twice
here method
public <t> void addobj(t obj) { if(head == null) head = new node(obj, null); node t = head; while(t.next != null) t = t.next; t.next = new node (obj,null); } the output dispays
obj1
obj1
obj2
obj3
obj4
Comments
Post a Comment