fork download
  1.  
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. class Clear {
  8.  
  9. public static void main(String a[]){
  10.  
  11. LinkedHashMap<String, String> lhm = new LinkedHashMap<String, String>();
  12. lhm.put("one", "This is first element");
  13. lhm.put("two", "This is second element");
  14. lhm.put("four", "Element inserted at 3rd position");
  15. System.out.println(lhm);
  16. lhm.clear();
  17. System.out.println(lhm);
  18. }
  19. }
Success #stdin #stdout 0.06s 3359744KB
stdin
Standard input is empty
stdout
{one=This is first element, two=This is second element, four=Element inserted at 3rd position}
{}