Template for coding findPhone
¥abstract class DeptDirectory {
¥  abstract String findPhone(String key);
¥F
¥
¥class Empty extends DeptDirectory {
¥  String findPhone(String key) { É }
¥  public String toString() { return "Empty()"; }
¥}
¥
¥class Cons extends DeptDirectory {
¥  Entry first;
¥  DeptDirectory rest;
¥
¥  Cons(Entry f, DeptDirectory r) {
¥    this.first = f;
¥    this.rest = r;
¥  }
¥
¥  Entry getFirst() { return this.first; }
¥  DeptDirectory getRest() { return this.rest; }
¥
¥  String findPhone(String key) {
¥É rest.findPhone(key) É
¥  }
¥  public String toString() { return "NonEmpty(" + first + ", " + rest + ")";  }
¥}
Fill in this method body
Fill in this method body