public class Node { // A very simple class for linked list nodes // Not polymorphic, these nodes are restricted to ints // We will just use null for empty lists. // Instance variables for two fields protected int data; protected Node next; // Constructor public Node(int d, Node n) { data = d; next = n; } // These nodes are immutable. we provide only accessor methods: public int getData() { return data; } public Node getNext() { return next; } }