Search the Community
Showing results for tags 'hashmap'.
Found 1 result
I have a hashmap of two objects, but it seems to return different values because the hashcode is different. Ex. [CODE]HashMap<HashMapTest, String> newMap = new HashMap<HashMapTest, String>(); newMap.put(new HashMapTest("test"), "line"); System.out.println(newMap.get(new HashMapTest("test")));[/CODE] the hashcodes are different when I put it in the hashmap and when I get it from the hashmap. Is there any way of fixing this?