When I create a single ArrayList, I create it as follows
ArrayList<Integer> al = new ArrayList<>();
When I create an array of ArrayList, I create it as follows
ArrayList<Integer>[] aal = new ArrayList[10];
My question is, why can't we specify the generics while creating an array, just like we do when creating an ArrayList. Why doesn't the following work to create an array of ArrayList
ArrayList<Integer>[] aal = new ArrayList<>()[10];
>`.
– Hovercraft Full Of Eels Mar 18 '17 at 19:14