Prev Next

Java / Set and its implementations

How does HashSet handles collision in Java?

Java HashSet handle Hash collisions automatically, however it is important to override both the equals and the hashcode methods, as both methods are utilized by Set to differentiate duplicate or unique entries.

More Related questions...

Show more question and Answers...


Comments & Discussions