// Declarations for a typical list-node class

public class ListNode {

    protected Object data;      // the information to be stored in the node
    protected ListNode next;    // the pointer to the next list-node

    // Constructors
    public ListNode (Object startingData) {
        data = startingData;
        next = null;
    }

    public ListNode (Object startingData, ListNode nextNode) {
        data = startingData;
        next = nextNode;
    }

    // extractors
    public Object getData () {
        return data;
    }

    public ListNode getNext () {
        return next;
    }

    // modifiers
    public void setData (Object newData) {
        data = newData;
    }

    public void setNext (ListNode newNext) {
        next = newNext;
    }
} // ListNode
