Topic
Java
Core Java for developers: syntax, object-oriented programming, collections, exceptions, generics, streams and multithreading.
Start with: Java equals and hashCode
1 article in 1 topic
Collections
- Java equals and hashCode: Why a HashSet Needs Both
== asks if it's the very same object, equals compares values, and hashCode puts equal objects in the same HashSet bucket. Three small programs show what breaks when hashCode is missing.