Java
Select all ...
Site Language: English
Українська
English
Русский
Programming Tests
Login
Sign Up
Programming Tests
Theory
Snippets
Papers
Landing
Android
Prices
FAQ
Cosmo Story
Terms and Conditions
Privacy Policy
Cookies Policy
Send Feedback
Select all correct statements regarding the concept of relationship between hashCode() and equals(Object o) methods
If you are comparing two objects equals method returns the value true, the value returned by hashCode () of these objects must match.
If you are comparing two objects equals method returns the value true, the value returned by hashCode () of these objects can not be the same.
If you are comparing two objects equals method returns the value false, the value returned by hashCode () of these objects must be different.
If you are comparing two objects equals method returns the value false, the value returned by hashCode () of these objects can be the same.
None of the statements above
Explanation
The key concept of the relationship methods hashCode () and equals (Object o) suggests the return of the same hash value in case of an equality of objects, but not the obligation to return a different value in the case of inequality objects.
equals method
hashcode
1
(1)
Like
Login in
to like
Comment
Login in
to comment
Share
Tweet
Related Content
In accordance with the contract, the hashCode() method should return the same in...
What will be the result of the following code execution? ...
What will be printed after execution of this code? clas...
Which data structure that implements a Map interface uses an == operator, rather...
What is the result of the following code execution? Int...
J
ava
Quiz
Login to learn Java
or
Read more about
Java Quizzes
Follow CodeGalaxy
Mobile Beta
Send Feedback
Keep exploring
Java quizzes
What will be printed out as a result of the following code execution / compilati...
What will be printed out as a result of the following code execution / compilati...
What will be printed out as a result of the following code execution / compilati...
What will be printed out as a result of the following code execution / compilati...
int i = Integer.MAX_VALUE + 10; What is th...
What happens after the following code is compiled and run: ...
Sign Up Now
or
Subscribe for future quizzes
Login in to like
Login in to comment