class Sock {  String size;  String color;  public boolean equals(Object o) {  Sock s = (Sock) o;  return color.equals(s.color);   }  // insert code here  }  哪两个满足 hashCode 的约定?()

A . public int hashCode() { return 343; } B . public int hashCode() { return size.hashCode (); } C . public int hashCode() { return color.hashCode (); } D . public int hashCode() { return (int) (Math.random() * 1000);

时间:2022-09-03 19:26:59 所属题库:Java认证考试综合练习题库

相似题目