PersonClient.java

Download
1/*2 * PersonClient.java3 *4 * A sample client program for the Person class5 * 6 * Do not open this file until you have completed parts 7-9.7 */8 9public class PersonClient {10    public static void main(String[] args) {11        Person kate = new Person("Kate Winslet", new Date(10, 5, 1975));12        System.out.println("kate = " + kate);   // toString() will be called13        String name = kate.getName();14        System.out.println("name: " + name);15        Date dob = kate.getDOB();16        System.out.println(" dob: " + dob);17        System.out.println();18        19        Date birthday = kate.getBirthdayIn(2013);20        System.out.println("Her birthday this year is: " + birthday);21        System.out.println();22        23        Date july4 = new Date(7, 4, 2013);        24        Date thanksgiving = new Date(11, 28, 2013);25        int age = kate.getAgeOn(july4);26        System.out.println("On July 4th she was " + age + " years old.");27        System.out.println("On her birthday she was " + kate.getAgeOn(birthday) + ".");28        System.out.println("On Thanksgiving she will be " + kate.getAgeOn(thanksgiving) + ".");29    }30}