Loading topic
List, Set, and Map. This chapter focuses on the difference between reference identity and logical equality.1 min readSet and Map, and override methods. This chapter focuses on the rule that connects hashCode() to equals().2 min readList, Set, and Map, and understand method overriding. This chapter focuses on how HashSet and HashMap use hashCode() and equals() together.2 min readHashSet and HashMap. The key rule is simple:2 min readjava.lang.Object.2 min readjava.lang.Object.2 min readList, Set, and Map. It also assumes you know that equals and hashCode must describe the same value.2 min readMap operations. You should also know that hashCode() returns an integer used by hash-based collections.2 min readList, Set, and Map, and understand method overriding.1 min readequals and hashCode contracts. The difficult part is deciding whether an object of a subclass should be equal to an object of its superclass.1 min readequals, hashCode, and toString.2 min readAssertionError, so the example runs without a testing library.2 min read