?? addressbookentry.java
字號:
/**
* Stores information for one address book entry. The following information
* is stored:
* <ol>
* <li>the name of a person, a <code>String</code>.</li>
* <li>the address of a person, a <code>String</code>.</li>
* <li>the telephone of a person, a <code>String</code>.</li>
* </ol>
*
* @author author name
* @version 1.0.0
*/
public class AddressBookEntry {
/* Name of the entry */
private String name;
/* Address of the entry */
private String address;
/* Telephone of the entry */
private String telephone;
/**
* Constructs an <code>AddressBookEntry</code> object.
*
* @param initialName the name of the person.
* @param initialAddress the address of the person.
* @param initialTelephone the telephone of the person.
*/
public AddressBookEntry (String initialName, String initialAddress,
String initialTelephone) {
this.name = initialName;
this.address = initialAddress;
this.telephone = initialTelephone;
}
/**
* Obtains the name of this entry.
*
* @return the name of this entry.
*/
public String getName() {
return this.name;
}
/**
* Obtains the address of this entry.
*
* @return the address of this entry.
*/
public String getAddress() {
return this.address;
}
/**
* Obtains the telephone number of this entry.
*
* @return the telephone number of this entry.
*/
public String getTelephone() {
return this.telephone;
}
/**
* Returns the string representation of this entry in the following
* format: <i>name</i>_<i>address</i>_<i>telephone</i>
*
* @return the string representation of this entry.
*/
public String toString() {
return getName() + "_" + getAddress() + "_" + getTelephone();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -