Person.java
1    /* 
2    * //Neeraj 10 01 2000 
3     */
4    
5    
6    
7    
8    package people;
9    
10   public class Person implements PersonSpecification {
11   
12   private String firstname;
13       private String lastname;
14       private int month;
15       private int day;
16       private int years;
17   
18       public Person(String name,int month,int day,int years){
19           int index = name.indexOf(" ");
20           this.firstname=name.substring(0,index);
21           this.lastname=name.substring(index+1);
22           this.month=month;
23           this.day=day;
24           this.years=years;
25       }
26   
27       public String toString(){
28           String display = firstname + " " + lastname + ", born " + month +"/" + day + "/" + years;
29           return display;
30       }
31   
32   
33       public String firstName() {
34           String first = firstname;
35           return first;
36       }
37   
38   
39       public String lastName() {
40           String last = lastname;
41           return last;
42       }
43   
44   
45       public int month() {
46           int m =month;
47           return m;
48       }
49   
50       public int day() {
51           int d =day;
52           return d;
53       }
54   
55   
56       public int years() {
57           int yr=years;
58           return yr;
59       }
60   
61       public String initials() {
62           String firstlast = firstname.substring(0,1) + lastname.substring(0,1);
63           String Upper = firstlast.toUpperCase();
64           return Upper;
65       }
66   
67   
68       public boolean isBoomer() {
69           return years >=1945 && years <=1964;
70       }
71   }
72