I have read What's the reason I can't create generic array types in Java? . I came to it when I tried this code:
HashMap<String, String>[] ret = new HashMap<String, String>[arraySize];
I decided to "get wild" and try something else
ArrayList<HashMap<String, String>> ret = new ArrayList<HashMap<String, String>>();
Now, what I don't understand is why the first option is bad/not-supported and the second option compiles.
What am I missing? In the first method I get an error and cannot compile while the second method has no compiler issues.
I prefer to follow intelligent programming principles, but do not understand the difference in this particular case.