1 package people; 2 3 public class Person implements PersonSpecification { 4 5 private String firstName; 6 private String lastName; 7 private int month; 8 private int day; 9 private int year; 10 11 public Person(String name, int month, int day, int year){ 12 this.month = month; 13 this.day = day; 14 this.year = year; 15 this.firstName = name.substring(0, name.indexOf(" ")); 16 this.lastName = name.substring((name.indexOf(" ") +1 )); 17 } 18 public String toString(){ 19 return(firstName + " " + lastName + ", born " + month + "/" + day + "/" + year); 20 } 21 public String firstName() { 22 return firstName; 23 } 24 public String lastName() { 25 return lastName; 26 } 27 public int month() { 28 return month; 29 } 30 public int day() { 31 return day; 32 } 33 public int year() { 34 return year; 35 } 36 public String initials() { 37 return (firstName.substring(0,1) + lastName.substring(0,1)); 38 } 39 public boolean isBoomer() { 40 return (year>=1944 & year<=1964); 41 } 42 } 43