Advertisement
Guest User

pidoras

a guest
May 29th, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.40 KB | None | 0 0
  1. //Test.java
  2. import java.util.HashMap;
  3.  
  4. public class Test {
  5.  
  6.     public static void main(String[] args) {
  7.         HashMap<TestClass, Integer> hashMap = new HashMap<>();
  8.         hashMap.put(new TestClass(), 1);
  9.     }
  10. }
  11.  
  12. //TestClass.java
  13.  
  14. class TestClass {
  15.  
  16.     @Override
  17.     public int hashCode()
  18.     {
  19.         System.out.println("Inside hashCode of TestClass");
  20.         return 1;
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement