Skip to content
New issue

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

以下关于equals方法和hashCode方法描述错误的是 #71

Open
waylau opened this issue Jul 4, 2020 · 0 comments
Open

以下关于equals方法和hashCode方法描述错误的是 #71

waylau opened this issue Jul 4, 2020 · 0 comments

Comments

@waylau
Copy link
Owner

waylau commented Jul 4, 2020

以下关于equals方法和hashCode方法描述错误的是(2分)

A. 同一次运行中,同一个对象如果equals方法中用到的信息没有改变,多次调用hashCode方法返回值必须相同
B. 如果两个对象调用equals方法时相等,则这两个对象的hashCode方法,也必须返回相同的值
C. “覆写equals方法时,应同时覆写hashCode方法”的好处是为了提升查询效率
D. 如果两个对象调用equals方法时不相等,则这两个对象的hashCode方法,不要求其返回值不同

你的回答D 是错误的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant