package lists; /* * A Node is an entity containing both a data object and a pointer * to another node, considered this node's successor. A Node has the * following methods: * * Node(Object obj) - makes a node containing obj * Object getData() - returns the node's data object * void setData(Object obj) - sets the node's data to obj * Node getNext() - returns the node's successor * void setNext(Node next) - sets the node's successor */ public class Node { private Object data; private Node next; public Node(Object data) { this.data = data; next = null; } public Object getData() { return data; } public void setData(Object data) { this.data = data; } public Node getNext() { return next; } public void setNext(Node next) { this.next = next; } }