Name - { lastName = ln; } public void setFirstName(String...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
package lab9; public class Name { p String lastName, firstName, middleInitial; S public Name() { lastName = " "; firstName = " "; middleInitial = " "; } public Name(String lName, String fName, String mInitial) { lastName = lName; firstName = fName; middleInitial = mInitial; } public String getLastName() { return lastName; } public String getFirstName() { return firstName; } public String getMiddleInitial() { return middleInitial; } public void setLastName(String ln)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { lastName = ln; } public void setFirstName(String fn) { firstName = fn; } public void setMiddleInitial(String mi) { middleInitial = mi; } public String toString() { return lastName+","+" "+firstName+" "+middleInitial+"."; } public boolean equals(Name aName) { return (lastName.equals(aName.getLastName()) && firstName.equals(aName.getFirstName()) && middleInitial.equals(aName.getMiddleInitial())); & } }...
View Full Document

This note was uploaded on 09/10/2009 for the course CS 102 taught by Professor Kanipiakins during the Spring '09 term at University of Maryland Baltimore.

Ask a homework question - tutors are online