public class ListNode  // class provided by College Board
 {private Object value;   // this is the do it yourself Linked List
  private ListNode next;

  public ListNode(Object initValue, ListNode initNext)
   {value = initValue;
    next = initNext;
    }

    public Object getValue()
     {return value;
      }

    public ListNode getNext()
     {return next;
      }

   public void setValue(Object theNewValue)
     {value = theNewValue;
     }

   public void setNext(ListNode theNewNext)
    {next = theNewNext;
    }
   }
   ************************************************************
   public class links
    {private ListNode head = null;
     private ListNode last = null;

      public void addNode(Object o)
       {ListNode n = new ListNode("",null);  // will fill in rather then use constructor
        n.setValue(o);
        if (head == null)
           {head = n;
           last = n;
           n.setNext(null);
           }
        else
          {last.setNext(n);
           n.setNext(null);
           last = n;
          }
       }

      public void displayList()
       {ListNode node = head;
        while (node != null)
         {System.out.println(node.getValue());
          node = node.getNext();
          }
        }
 }
 *********************************************************

 import java.io.*;

 public class linktester
  {static input in = new input();

  public static void main(String [] args) throws IOException
   {links l = new links();
    String n;
     System.out.println("Enter a name or E to end ");
     n = in.getString();
     while (n.compareTo("E") != 0)
      {l.addNode(n);
       System.out.println("Enter a name or E to end ");
       n = in.getString();
       }
       System.out.println("");
        System.out.println("");
       l.displayList();
    }
 }