public class NameFormatter { //Instance Variables private String firstName; //First Name private String secondName; //Second Name (may be null) private String lastName; //Last Name (may be null) //Constructor //Parameter name: The complete source name, parts separated by spaces //Exception thrown if there is not at least 1 name-part //Cases // 1 name part : firstName only, secondName and lastName null // 2 name parts : firstName and LastName only, secondName null // 3+ name parts: firstName, secondName and lastName, others ignored public NameFormatter(String name) { firstName = secondName = lastName = null; } //Accessors public String getFirstName() { return firstName; } public String getSecondName() { return secondName; } public String getLastName() { return lastName; } //Return the full name // First or First Last or First Second Last public String fullName() { return ""; } //Return the name in listing format // First or Last, First or Last, First S. public String listName() { return ""; } //Return the name in brief format // First or F. Last or F. S. Last public String briefName() { return ""; } //Return the initials // F or FL or FSL public String initials() { return ""; } }