// A program that uses the Person interface and the PersonImpl class. // Barry Cornelius, 19 June 2000 import java.io. BufferedReader; import java.io. InputStreamReader; import java.io. IOException; public class PersonImplProg { public static void main(final String[] pArgs) throws IOException { final BufferedReader tKeyboard = new BufferedReader(new InputStreamReader(System.in)); System.out.println("Type in a person using the format " + "Name%DateOfBirth%PhoneNumber%Height"); final String tLine = tKeyboard.readLine(); final Person tPerson = new PersonImpl(tLine); System.out.println("The person is: " + tPerson); final String tName = tPerson.getName(); System.out.println("Their name is: " + tName); final Date tDateOfBirth = tPerson.getDateOfBirth(); System.out.println("Their date of birth is: " + tDateOfBirth); final String tPhoneNumber = tPerson.getPhoneNumber(); System.out.println("Their phone number is: " + tPhoneNumber); final double tHeight = tPerson.getHeight(); System.out.println("Their height is: " + tHeight); final Person tAnotherPerson = new PersonImpl("Smith, Rebecca", new DateImpl(1981, 2, 27), "44-1987-654321", 1.6); System.out.println(tPerson.equals(tAnotherPerson)); } }