public class Person implements Comparable{ private String firstName; private String lastName; private int age; private char gender; private String ssn; // Constructor method (has same name as class but with Captial letter) // 1st line of constructor initializes the fields of the Person object we are creating public Person(String firstName, String lastName, int age, char gender, String ssn){ this.firstName = firstName; this.lastName = lastName; this.age = age; this.gender = gender; this.ssn = ssn; } // Getters and Setters methods public String getFirstName(){ return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName(){ return lastName; } public void setLastName(String lastName){ this.lastName = lastName; } public int getAge(){ return age; } public void setAge(int age){ this.age = age; } public char getGender(){ return gender; } public void setGender(char gender){ this.gender = gender; } public String getSsn(){ return ssn; } public void setSsn(String ssn){ this.ssn = ssn; } public String getFullName(){ return firstName + " " + lastName; } public void talk(){ System.out.println("Hello! My name is: " + firstName + " " + lastName); } public String toString(){ return "Person [firstName=" + firstName + ", lastName=" + lastName + ", age=" + age + ", gender=" + gender + ", ssn=" + ssn + "]"; } public int compareTo(Person person) { return this.lastName.compareTo(person.getLastName()); } }