Here\'s what I have:
public class Node{
Object data;
Node next;
Node(Object data, Node next){
this.data = data;
this.next = next
Node n = head;
while(n.getNext() != null){
n = n.getNext();
}
n.setNext(nodeToAdd);
That's not sorted, which I can't tell from your question if you want it sorted. Which opens up another whole can of worms such as what do you want to sort on, if you have a linked list of type Object there isn't really anything meaningful to sort on.