/* * ListNode class */ public class ListNode { private Object element; // node element private ListNode next; // next node /* * store the element in the node */ public void setElement( Object e ) { element = e; } /* * return the element stored in the node */ public Object getElement() { return element; } /* * store the reference to the next node */ public void setNext( ListNode e ) { next = e; } /* * return the reference to the next node */ public ListNode getNext() { return next; } }