class Node{ private Node neste; private T data; public Node(T data){ this.data = data; } public void settNeste(Node neste){ this.neste = neste; } public Node hentNeste(){ return neste; } public T hentData(){ return data; } @Override public String toString(){ Node tmp = this; String tmpString = ""; while(tmp != null){ tmpString += tmp.hentData() + " --> "; tmp = tmp.hentNeste(); } return tmpString; } }