Im getting compile error when I tried instantiating above method with this:
new HashMap<String, new HashMap<String, JsonNode>()>()
Thanks
Im getting compile error when I tried instantiating above method with this:
new HashMap<String, new HashMap<String, JsonNode>()>()
Thanks
When you call the constructor, you can use Diamond Inference to tell the compiler to "figure it out":
Map<String, Map<String, JsonNode>> myMap = new HashMap<>();
If you really want to declare the whole type, then it's similar to the variable declaration. You only use the parenthesizes when you call the constructor, not for each generic type:
Map<String, Map<String, JsonNode>> myMap = new HashMap<String, Map<String, JsonNode>>();