Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.HashMap;
- class Trial {
- public static void main(String[] args) {
- System.out.println("*** start ***");
- try {
- HashMap<Integer, HashMap<Integer, String>> mapHolder =
- new HashMap<Integer, HashMap<Integer, String>>();
- HashMap<Integer, String> tmpMap1 = new HashMap<Integer, String>();
- tmpMap1.put(1, "Judy");
- tmpMap1.put(2, "Caty");
- HashMap<Integer, String> tmpMap2 = new HashMap<Integer, String>();
- tmpMap2.put(1, "John");
- tmpMap2.put(2, "Charles");
- tmpMap2.put(3, "Mike");
- mapHolder.put(1, tmpMap1);
- mapHolder.put(2, tmpMap2);
- System.out.println("2nd of the 2nd : " + mapHolder.get(2).get(2)); // Charles
- } catch (Exception e) {
- e.printStackTrace();
- }
- System.out.println("*** end ***");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement