/**
 * Tests the Person class by creating a couple instances
 * and printing out the results of various method calls.
 *
 * @author Zach Tomaszewski
 * @version 11 Mar 2008
 */
public class PersonTester {

  public static void main(String[] args) {

    System.out.println("Number of persons created so far: " +
                       Person.getNumberOfPeople());

    System.out.println();
    System.out.println("Bob was born in 1980.");
    Person bob = new Person("Bob", 1980);

    System.out.println("Bob's details from his Person object: ");
    System.out.println("Name = " + bob.getName());
    System.out.println("Year of Birth = " + bob.getYearOfBirth());
    System.out.println("Current Age (roughly) = " + bob.getAge());

    System.out.println();
    System.out.println("John was just born.");
    Person john = new Person("John"); //testing other constructor

    System.out.println("John's details from his Person object: ");
    System.out.println("Name = " + john.getName());
    System.out.println("Year of Birth = " + john.getYearOfBirth());
    System.out.println("Current Age (roughly) = " + john.getAge());

    System.out.println();
    System.out.println("Changing John's year of birth to 1980.");
    john.setYearOfBirth(1980);
    System.out.println("Year of birth now = " + john.getYearOfBirth());

    System.out.print("Printing out John using toString: ");
    System.out.println(john.toString());

    System.out.println();
    System.out.println("Number of persons created so far: " +
                       Person.getNumberOfPeople());
  }

}
