Here\'s what I have:
public class Node{
Object data;
Node next;
Node(Object data, Node next){
this.data = data;
this.next = next
public void addToEnd(Object data){
Node temp = this;
while(temp.next!=null)temp=temp.next;
temp.next=new Node(data, null);
}
It's a linked list. You either have to
A) iterate through all your nodes starting at the head, find the last node, then add one.
or
B) keep track of the tail, add to the tail, then update tail to the new last node.