Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Test.java
- import java.util.HashMap;
- public class Test {
- public static void main(String[] args) {
- HashMap<TestClass, Integer> hashMap = new HashMap<>();
- hashMap.put(new TestClass(), 1);
- }
- }
- //TestClass.java
- class TestClass {
- @Override
- public int hashCode()
- {
- System.out.println("Inside hashCode of TestClass");
- return 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement