99色精品-9色在线-99色在线-99色视频 国产欧美日产一区二区三区_亚洲精品亚洲人成在线观看_四虎在线精品永久观看_免费一级a一片久久精

單項選擇題

public class Person { 
private String name, comment; 
private int age; 
public Person(String n, int a, String c) { 
name = n; age = a; comment = c; 
} 
public boolean equals(Object o) { 
if(! (o instanceof Person)) return false; 
Person p = (Person)o; 
return age == p.age && name.equals(p.name); 
} 
} 
What is the appropriate definition of the hashCode method in class Person?() 

A. return super.hashCode();
B. return name.hashCode() + age * 7;
C. return name.hashCode() + comment.hashCode() /2;
D. return name.hashCode() + comment.hashCode() / 2 - age * 3;

微信掃碼免費搜題