View Single Post
  #2 (permalink)  
Old 03-29-2008, 05:27 AM
Vicious Vicious is offline
Member
 
Join Date: Mar 2008
Posts: 2
Vicious is on a distinguished road
Actually,HashMap is composed of Map.Entry<K,V>,so you can see,one key maps one one value.if you use map.put(k1,v1),you can obtain v1 using method map.get(k1).but if you continue useing map.put(k1,v2),this v1 must be covered by v2.sothat you can only obtain v2 if you use the method map.get(k1) once more.So come back to your problem,you could't get all values int a HashMap,but only get the lasted value through map.get(k).
Reply With Quote