CS1 Standard Demo Page

The following text was written to the standard output stream when the Person.java program was executed from Netbeans.

 /*
   * To model a person in terms of five properties, first name and last name, 
   * month, day, and year of birth. 
   */
  package people;
  
  /**
   *
   * @author ecuevas
  */
 public class Person implements PersonSpecification{
     
     // THE INSTANCE VARIABLES (STATE)
     
     private String firstName;
     private String lastName;
     private int month;
     private int day;
     private int year;
      
     //THE CONSTRUCTORS
      
     public Person(String name, int month, int day, int year) {
         this.firstName = name.substring(0,name.indexOf(" "));
         this.lastName = name.substring(name.indexOf(" ")+1);
         this.month = month;
         this.day = day;
         this.year = year;
         }
    
     //THE METHODS (BEHAVIOR)
     public String toString(){
         String representation = firstName + " " + lastName + ", born " + month 
                 + "/" + day + "/" + year;
         return representation;
     }
 
     @Override
     public String firstName() {
         return firstName;
     }
 
     @Override
     public String lastName() {
         return lastName;
     }
 
     @Override
     public int month() {
         return month;
     }
 
     @Override
     public int day() {
         return day;
     }
 
     @Override
     public int year() {
         return year;
     }
 
     @Override
     public String initials() {
         return firstName.substring(0,1) + lastName.substring(0,1);
     }
 
     @Override
     public boolean isBoomer() {
         return (year <= 1964 & year >= 1946);
     }
 
    
 }