I know there is a similar question.
But the question I have here is different.
My problem I have is about on how to create a Multi-dimensional ArrayList. I know like for 2 dimensions I can do this
ArrayList<ArrayList<Integer>> dim2 = new ArrayList<ArrayList<Integer>>();
And I can keep on adding the dimensions like that. But for an array like that can be managable until 3 or 4 dimensions. (Readability will decrease if keep on doing that)
Is there any way or any class such that I can declare the dimensions of the ArrayList dynamically. I mean that the dimensions of the array should be declared at run time.
The above mentioned 2+ dimensional array is hard coded.
How can I achieve dynamic dimension declaration?