⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addressbookentry.java

📁 iCarnegie SSD3 exam3
💻 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 + -