Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Map<String, Map<String, Double>> twoLevelMap = new HashMap<>();
- // now put "foo", "bar" -> 3.14159 into the map
- twoLevelMap.computeIfAbsent("foo", key -> new HashMap<String, Double>())
- .put("bar", 3.14159);
- // now get the value from the map
- System.out.println(twoLevelMap.get("foo").get("bar"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement