We have finally introduced enough Java mechanics to define the data required to represent the department directory entries described in Section 1.1.2. Recall that a directory entry is a object with the following fields and methods:
Fields: String name; String address; String phone; Methods: String getName(); String getAddress(); String getPhone();In Java, we define this new form of data as the class
class Entry { /* fields */ String name; String address; String phone; /* accessors */ String getName() { return this.name; } String getAddress() { return this.address; } String getPhone() { return this.phone; } }