/** * A class to represent a personal contact. Contact objects have a first name, * last name, and phone number */ public class Contact { //instance variables private String first; // first name private String last; // first name // TO DO 1: declare another instance variable to store the phone number private String phone ; // Done! // TO DO 2: write the the Contact class constructor. The constructor will // have 3 "construction parameters" to initialize the instance variables // HINT: see the BankAccount constructor public Contact(String firstName, String lastName, String phoneNumber) { first = firstName ; last = lastName ; phone = phoneNumber ; } // Done! // TO DO 3: write an accessor (aka "get") method that returns the phone // number // HINT: see accessor methods getFirst and getLast, below /** * Get the phone number * * @return the phone number of the Contact */ public String getPhone() { return phone; } // Done! // NEW TO DO: write a mutator method to change the phone number of a // Contact object /** * Get the first name * * @return the first name of the Contact */ public String getFirst() { return first; } /** * Get the last name * * @return the last name of the Contact */ public String getLast() { return last; } }