this is my code. please tell me what is wrong here and how to correct it
public void displayList(){ //displays items on the list
Node current = head;
while(current!=null){
current = current.next;
System.out.println(current);
}