I was using the following code to create a generic array of lists to mix up different types of lists:
List<Integer>[] intLists = (List<Integer>[])new List[] {Arrays.asList(1)};
List<? extends Object>[] objectList = intLists;
objectList[0] = Arrays.asList(1.01);
int n = objectList[0].get(0); // class cast exception!
But it gave me a cast exception. How can I work around this?