hashCode and equals methods are belonging to a concrete object and need members belonging to the object to compute any meaningful value.
Eg. if you want to compare two instances of the same class, you do that by comparing their "computed values" through their equals and/or hashCode methods.
Static methods and members belong to the class and not to the concrete instance uniquely.
大概的意思就是必须有非静态的成员变量,才能作比较,而作比较就得调用那个它们的equals,比较他们的hashCode这些。总而言之,言而总之,你的这个java文件的这个类必须有
public String name;
这种定义,不然不能帮你自动生成出来。()