I want to have an array of ArrayLists:
ArrayList<MyClass>[] myArray;
I want to initialize it by the following code:
myArray = new ArrayList<MyClass>[2];
But I get this error:
Cannot create a generic array of ArrayList<MyClass>
How can I initialize it?