package myfirstlinkedlist;

/**
 * Title:        My First Linked List
 * Description:  Example of a linked list implementation
 * Copyright:    Copyright (c) 2001
 * Company:
 * @author Burton Rosenberg
 * @version 1.0
 */

public class LinkedList {

  Node anchor = null ;

  public LinkedList() {
  }

  void addWord(String newWord)
  {
      Node n = new Node() ;
      n.content = newWord ;
      n.next = anchor ;
      anchor = n ;
  }

  void printWords()
  {
     Node n = anchor ;
     while ( n!=null )
     {
        System.out.println(n.content);
        n = n.next ;
     }
  }

}