How does one instantiate an array of maps in Java?
Not strictly an answer to your question, but have you considered using a List instead? List<Map<String,Integer>> maps = new ArrayList<Map<String,Integer>>(); … maps.add(new HashMap<String,Integer>()); seems to work just fine. See Java theory and practice: Generics gotchas for a detailed explanation of why mixing arrays with generics is discouraged. Update: As mentioned by Drew in the comments, … Read more