0 votes
in JAVA by
Can we use random numbers in the hashcode() method?

1 Answer

0 votes
by

No, because hashcode of an object should be always same. See the answer to learning more about things to remember while overriding hashCode() method in Java.

Related questions

0 votes
asked Jan 27, 2020 in JAVA by rahuljain1
0 votes
asked Apr 30, 2021 in JAVA by rajeshsharma
...