person.java
1    
2    
3            package people;
4    
5     class Person implements PersonSpecification {
6    
7        private String firstName;
8        private String lastName;
9        private int month;
10       private int day;
11       private int  year;
12   
13       public Person(String name, int month, int day, int year )
14       {
15           this.firstName= name.substring(0,name.indexOf(" "));
16           this.lastName =  name.substring(name.indexOf(" ")+1);
17           this.month= month;
18           this.day= day;
19           this.year= year;
20       }
21       public String toString()
22       {
23           return  firstName + "," +lastName  +"  born  " +month+"/"+day+"/"+year;
24   
25       }
26   
27   
28       public String firstName() {
29   
30           return firstName;
31       }
32   
33       public String lastName() {
34           return lastName;
35       }
36   
37   
38       public int month() {
39           return month;
40       }
41   
42   
43       public int day() {
44           return day;
45       }
46   
47   
48       public int year() {
49           return year;
50       }
51       public String initials() {
52           return firstName.substring(0,1) + lastName.substring(0,1);
53       }
54   
55       public boolean isBoomer()
56       {
57           return year >=1945 && year <=1964;
58       }
59   
60       public String lasName() {
61           throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
62       }
63   }
64   
65