We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
期末试题第二题
我实验得到的结果:HashSet的size是2。
原因:
public boolean equals(Value v) { return v.i == i; }
重写部分规则: 参数列表与被重写方法的参数列表必须完全相同。 返回类型与被重写方法的返回类型可以不相同,但是必须是父类返回值的派生类(java5 及更早版本返回类型要一样,java7 及更高版本可以不同)。
重写部分规则:
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
No branches or pull requests
我实验得到的结果:HashSet的size是2。
原因:
public boolean equals(Value v) { return v.i == i; }
并不是对父类equals(Object var1)的重写。The text was updated successfully, but these errors were encountered: