试题详情
多项选择题 public class Key {  private long id1;  private long 1d2;  // class Key methods  }  A programmer is developing a class Key, that will be used as a key in a standard java.util.HashMap. Which two methods should be overridden to assure that Key works correctly as a key?()

A、 public int hashCode()

B、 public boolean equals(Key k)

C、 public int compareTo(Object o)

D、 public boolean equals(Object o)

E、 public boolean compareTo(Key k)

  • A,D
  • 关注下方微信公众号,在线模考后查看

热门试题