Java Question: What are the differences between a hashcode and equals methods
Anoniem
hashcode(): This method is used to get unique integer for given object. This integer is used to find bucket when storing in hashmap. By default, This method returns integer representation of memory address where object is stored. equals(): This method is used to simply check the equality between two objects. By default, it checks where two reference refer to same object or not(==).