¥abstract
class CityEntry {
¥ String name, address, phone;
¥ CityEntry(String n, String a, String p)
{
¥ name = n;
¥ address = a;
¥ phone = p;
¥ }
¥ String getName() { return name; }
¥ String getAddress() { return address;
}
¥ String getPhone() { return phone; }
¥ /** Returns all of the information in
the listing */
¥ /* String toString() */
¥}
¥class
BusinessEntry extends CityEntry {
¥ String city, state;
¥ BusinessEntry(String n, String a,
String p, String c, String s) {
¥ super(n,a,p);
¥ this.city = c;
¥ this.state = s;
¥ }
¥ String getCity() { return this.city; }
¥ String getState() { return this.state; }
¥ public String toString() {
¥ return "Business[" +
this.getName() + "," + this.getAddress() + "," +
¥ this.getPhone()
+ "," + this.city + "," + this.state + "]";
¥ }
¥}