How does the .nextnode points to the next node I'm confused here
public class Singly_linked_list { //Represent a node of the singly linked list class Node { int data; Node nextnode; Node(int data) { this.data = data; this.nextnode = null; } } //Represent the head and tail of the singly linked list public Node head = null; public Node tail = null; //addNode() will add a new node to the list public void addNode(int data) { //Create a new node Node newNode = new Node(data); //Checks if the list is empty if(head == null) { //If list is empty, both head and tail will point to new node head = newNode; tail = newNode; } else { //newNode will be added after tail such that tail's next will point to newNode tail.nextnode = newNode; //newNode will become new tail of the list tail = newNode; } }