by ardit33 · 9y ago · 0 comments
ArrayList<Map<String,Object>> myArrayList = new ArrayList<Map<String,Object>>();
Could have been just:
ArrayList<Map<String,Object>> myArrayList = new();
or even better:
ArrayList<Map> = new(); <- if you don't care what the type of map is.
> if you don't care what the type of map is
You can use raw types, it works perfectly fine (just generates a compiler warning). For explicitly being unspecific, you can also use a type wildcard (`?`).
ArrayList<Map> myArrayList = new ArrayList<>(); works already today.
ArrayList<Map<String,Object>> myArrayList = new ArrayList<>();