I have a HashMap as follows:
HashMap<Integer, List<MyClassObj>> hmap = new HashMap<Integer, List<MyClassObj>>();
In a loop, I append to a List and then I put in a key, value pair where List is the value into my hmap
object
How can I extract the values in the list for each key?
for (Integer k: hmap.keySet()) {
String key = k.toString();
String value = hmap.get(k).toString();
System.out.println(key + " " + value);
}
This outputs :
43115 [mypackage@176f3f8, mypackage@176f3f8, mypackage@176f3f8]
40715 [mypackage@176f3f8, mypackage@176f3f8, mypackage@176f3f8]
Why is this returning my package and a hashkey?
How can I see the contents of each list?