This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Because generics in Java don't work that way. You can't assign an array of EnumMap<T, U> to an array of Map<T, U>.
Actually you can, once you are able to create one. Because Map is a super type of EnumMap, Map is a super type of EnumMap.
Creating the array is the problem, because generics don't allow you to create arrays of generic types. The reason is because the compiler cannot guarantee type safety anymore. Consider, assuming line 1 would not create a compiler error:
With non-generic types line 3 would have already created a ClassCastException, and therefore it's easier to find the cause of the problem. In this case the ClassCastException comes at a point where you no longer know why it went wrong.
Anyway, with only one compiler warning you can create the values map: