This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I can't remember why, but a search of this forum will reveal old posts about the same subject. You cannot create an array of parameterised type. So List myLists = new ArrayList; is permissible. But List<Foo> myFooLists = new ArrayList<Foo>; is not permissible. It has something to do with erasure rather than reification in generics, but it is better explained in the older posts.
Not like that, but yes, you can create arrays of Arraylists:
But I wouldn't advise to do it like that. The (rather ugly) casting will also cause the compiler to cough up warning(s) (not errors!). So I advise to use List<List<String>>, or something similar instead. [ October 15, 2008: Message edited by: Piet Verdriet ]