Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. HashMap<String, String> map = new HashMap<String, String>(){
  2. @Override
  3. public boolean equals(Object o) {
  4. // TODO comparison here
  5. return super.equals(o);
  6. }
  7. };
  8. map.equals(new HashMap<String, String>());
  9.  
  10. public class NewHashMap<K,V> extends HashMap<K, V>
  11.  
  12. @Override
  13. public boolean equals(Object o) {
  14. // Your code
  15. }
  16.  
  17. public class HashMapComparator {
  18. boolean static areMapsEqual(HashMap<String, String> aMap, HashMap<String, String> bMap) {
  19. ....
  20. }
  21. }
  22.  
  23. boolean mapsAreEqual = HashMapComparator.areMapsEqual(firstMap, secondMap);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement