fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. class TestCollection13{
  5. public static void main(String args[]){
  6. HashMap<Integer,String> hm=new HashMap<Integer,String>();
  7. hm.put(100,"Amit");
  8. hm.put(101,"Vijay");
  9. hm.put(102,"Rahul");
  10. hm.put(102,"dahul");
  11. hm.remove(100);
  12. for(Map.Entry m:hm.entrySet()){
  13. System.out.println(m.getKey()+" "+m.getValue());
  14. }
  15. }
  16. }
Success #stdin #stdout 0.04s 4386816KB
stdin
Standard input is empty
stdout
101 Vijay
102 dahul