I have a map and this contains objects, lets say of type 'Apple'. I currently have an iterator but the only thing I seem to be able to call is the getKey and getValue. getValue seems to return the memory address of the actual Apple object, but i wanted to be able to do Apple a = Map.Entry.getValue()
i can only seem to get the key and memory address :s
Iterator it = ApplesMap.entrySet().iterator();
while (it.hasNext()) {
Map.Entry entries = (Map.Entry)it.next();
System.out.println(entries.getKey() + " = " + entries.getValue());
//Apple a = entries.getValue();
}
hashcodeof that object.