Wednesday, June 30, 2010

public class Person
{
    // fields
    private String name; // the person's name
    private int maximumBooks;
   
    // constructor
    public Person()
    {
        name = "unknown name";
        maximumBooks = 3;
    }
    qccs212.blogspot.com
    // getters and setters
    public String getName()
    {
        return name;
    }
   
    public void setName(String n)
    {
        name = n;
    }

    public int getMaximumBooks() {
        return maximumBooks;
    }

    public void setMaximumBooks(int maxBooks) {
        maximumBooks = maxBooks;
    }
   
}

No comments:

Post a Comment