Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. Map<String, Map<String, Double>> twoLevelMap = new HashMap<>();
  2. // now put "foo", "bar" -> 3.14159 into the map
  3. twoLevelMap.computeIfAbsent("foo", key -> new HashMap<String, Double>())
  4. .put("bar", 3.14159);
  5. // now get the value from the map
  6. System.out.println(twoLevelMap.get("foo").get("bar"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement