CS1 Standard Demo Page

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

package people;

public class Person implements PersonSpecification {
    private String firstName;
    private String lastName;
    private int month;
    private int day;
    private int year;

    public Person(String name, int month, int day, int year){
        int spacePosition = name.indexOf(" ");
        firstName = name.substring(0, spacePosition);
        lastName = name.substring(spacePosition);
        this.month = month;
        this.day = day;
        this.year = year;
    }
    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(1, 2);
    }

    @Override
    public boolean isBoomer() {
        if (year <= 1964){
            return true;
        } else {return false; }
    }
}