fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. String cust_idnt_id = "UTLZ_226";
  13.  
  14. Map<String, Object> map1 = new HashMap<String, Object>();
  15. Map<String, Map<String, Object>> map2 = new HashMap<String, Map<String, Object>>();
  16.  
  17. for(int i=0; i<2; i++){
  18.  
  19. map1 = new HashMap<String, Object>();
  20. map2 = new HashMap<String, Map<String, Object>>();
  21.  
  22.  
  23. if(i==0){
  24. map1.put("PAY_AMT", 100);
  25. map1.put("RECV_AMT", 100);
  26. } else {
  27. map1.put("PAY_AMT", 200);
  28. map1.put("RECV_AMT", 200);
  29. }
  30.  
  31. map2.put(cust_idnt_id, map1);
  32.  
  33. }
  34.  
  35. map1 = new HashMap<String, Object>();
  36.  
  37. map1.put("PAY_AMT", 300);
  38. map1.put("RECV_AMT", 300);
  39.  
  40. map2.put("UTLZ_999", map1);
  41.  
  42. for(String key : map2.keySet()){
  43. System.out.println(map2.get(key));
  44. }
  45.  
  46. }
  47. }
Success #stdin #stdout 0.04s 4386816KB
stdin
Standard input is empty
stdout
{RECV_AMT=300, PAY_AMT=300}
{RECV_AMT=200, PAY_AMT=200}