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?()
多选题
2022-05-08 05:24
A、 public int hashCode()
B、 public void hashCode()
C、 public int compareTo(Object o)
D、 public boolean equals(Object o)
E、 public boolean compareTo(Key k)