我应该创建一个派生属性,该属性将具有处理诸如“Mark E. Brown”之类的值的访问器和修改器。
我不明白这个词。这对我来说是新的。帮助?
public String getFullName()
{
return fullName = getFirstName() + " " + getMiddleInitial() + " " + getLastName();
}
public void setFullName(String aFirstName, String aLastName, String aMiddleInitial)
{
firstName = aFirstName;
lastName = aLastName;
middleInitial = aMiddleInitial;
fullName = aFirstName + " " + aMiddleInitial + " " + aLastName;
}