That's a quirk of generics in java. You have to declare the array like so:
HashMap[] maps = new HashMap[10];
later you can create each Map personally, example :
for(int i=0;i<10;i++)
{
maps[i] = new HashMap();
}
This is a consequence of erasure. The array is an array of HashMap
s. The generic type param is not retained. You'll get a warning about this, but it will compile and you can suppress the warning with the @SuppressWarning("unchecked")
annotation.