How can I define in Java a Matrix of ArrayList< String>.
I am trying with:
Arraylist<String>[][] data =new ArrayList<String>[5][5];
But that throws this error:
Cannot create a generic array of ArrayList
Any idea?
How can I define in Java a Matrix of ArrayList< String>.
I am trying with:
Arraylist<String>[][] data =new ArrayList<String>[5][5];
But that throws this error:
Cannot create a generic array of ArrayList
Any idea?
This is not allowed in Java, why dont you try and use nested ArrayList like this ArrayList<ArrayList<String>>.