UNB/ CS/ David Bremner/ teaching/ java/ PhoneLink.java
public class PhoneLink{

    String name;
    String number;
    PhoneLink next=null;
 
    public PhoneLink(String theName, String theNumber){
        name=theName;
        number=theNumber;
        next=null;
    }

    /**
     * Gets the value of name
     *
     * @return the value of name
     */
    public String getName()  {
        return this.name;
    }

    /**
     * Sets the value of name
     *
     * @param argName Value to assign to this.name
     */
    public void setName(String argName) {
        this.name = argName;
    }

    /**
     * Gets the value of number
     *
     * @return the value of number
     */
    public String getNumber()  {
        return this.number;
    }

    /**
     * Sets the value of number
     *
     * @param argNumber Value to assign to this.number
     */
    public void setNumber(String argNumber) {
        this.number = argNumber;
    }

    /**
     * Gets the value of next
     *
     * @return the value of next
     */
    public PhoneLink getNext()  {
        return this.next;
    }


    
    /**
     * Sets the value of next
     *
     * @param argNext Value to assign to this.next
     */
    public void setNext(PhoneLink argNext) {
        this.next = argNext;
    }
    
    public static void main(String[] args){
        PhoneLink link1=new PhoneLink("David Bremner", "555-1212");
        PhoneLink link2=new PhoneLink("Bela Lugosi", "666-1522");
        PhoneLink link3=new PhoneLink("Jesse James", "IAM-DEAD");
        
        link1.setNext(link2);
        link2.setNext(link3);

        System.out.println(link1.getNext().getNext().getNumber());
        
        
    }
}