Which of the following statements are true?

1. if obj1.equals(obj2) then obj1.hashcode() == obj2.hashcode()
2. if !obj1.equals(obj2) then obj1.hashcode() != obj2.hashcode()
a. 1
b. 2
c. both
d. none


a. 1
If hash function is implemented properly, then objects that are equal have the same hash. On the other hand, objects that are not equal can have the same hashcode.

Computer Science & Information Technology

You might also like to view...

Which is NOT a way a return statement can be used?

A. When a function needs to return a value to the calling function. B. Only at the end of main() to clear the program. C. When the program needs to “bail out” of a function. D. To go back to the previous function.

Computer Science & Information Technology

How can you control the number of virtual machines that the user can run simultaneously?

What will be an ideal response?

Computer Science & Information Technology

____ is needed to achieve success in deploying a patch to a large network.

A. Automated patch installation software B. An inventory of all hardware and software on affected computers C. External patch management hardware D. A synchronized deployment on all computers

Computer Science & Information Technology

The GPS receiver can deduce its own location based on a mathematical principle called ____________________.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology