Есть некая собственная реализация связного списка или что то похожего. Хочу понять как он работает в определенном методе public class Node<T> { private T info; private Node<T> next; public Node(T x) { this.info = x; this.next = null; } public Node(T x, Node<T> next) { this.info = x; this.next = next; } public T getInfo() { return this.info; } public void setInfo(T x) { this.info = x; } public Node<T> getNext() { return this.next; } public void setNext(Node<T> next) { this.next = next; } } Когда мы заполняем этот список, мы присваиваем ссылке node новое значение в итоге первоначальное должно было потеряться, но когда мы вызываем метод по выводу то все значения выводятся по порядку начиная с первого. Как такое происходит ? public class Main { public static void main(String[] args) { Node<Integer> node = new Node<Integer>(5); fillNode(node); nodePrint(node); } public static void fillNode(Node<Integer> node) { for (int i = 0; i < 4; i++) { node.setNext(new Node<Integer>(i)); node = node.getNext(); } } public static void nodePrint(Node < Integer > node){ while (node != null) { System.out.println(node.getInfo()); node = node.getNext(); } } }