Advertisement
Guest User

Untitled

a guest
Feb 24th, 2012
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. import java.util.HashMap;
  3.  
  4. class Trial {
  5.  
  6.     public static void main(String[] args) {
  7.         System.out.println("*** start ***");
  8.  
  9.         try {
  10.  
  11.             HashMap<Integer, HashMap<Integer, String>> mapHolder =
  12.                     new HashMap<Integer, HashMap<Integer, String>>();
  13.  
  14.             HashMap<Integer, String> tmpMap1 = new HashMap<Integer, String>();
  15.             tmpMap1.put(1, "Judy");
  16.             tmpMap1.put(2, "Caty");
  17.  
  18.             HashMap<Integer, String> tmpMap2 = new HashMap<Integer, String>();
  19.             tmpMap2.put(1, "John");
  20.             tmpMap2.put(2, "Charles");
  21.             tmpMap2.put(3, "Mike");
  22.  
  23.             mapHolder.put(1, tmpMap1);
  24.             mapHolder.put(2, tmpMap2);
  25.  
  26.             System.out.println("2nd of the 2nd : " + mapHolder.get(2).get(2)); // Charles
  27.  
  28.         } catch (Exception e) {
  29.             e.printStackTrace();
  30.         }
  31.  
  32.         System.out.println("***  end  ***");
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement