I've got a problem. I need to create an array of arrays of arrays. I've read some articles about creating dynamic arrays in Java, but I'm not sure about what way I should choose.
The first one is to declare max possible size of each array int arr[][][] = new int[10000][10000][10000];, but in my case size of each array depends on size of another. I mean that each array can possibly has a size of max array and if I declare my array of arrays of arrays with this way it should take a lot of memory size.
The way is to use ArrayList. But I never used it before and I don't know the syntax of declaring ListArray of ListArrays and moreover ListArray of ListArrays of ListArrays. Also, I'm not sure about whether I should use it or not, because ListArray contains objects as elements and if I have an array like [10000][100][20] what is going to happen with my memory usage and other pc resources?..
The third problem is that in the best case scenario I'd like to have not objects or any other datatype variables as elements of array but links to other elements of another arrays element (I mean arr[z][x][y] = @arrOfStr[i]). I've never used links in Java though and I don't even know is it possible to use links as array elements and how should I declare my array.
So guys, I really need help in this because I've already broken my brain trying to resolve this problem with using minimum amount of pc resources.
Any help appreciated!
List<List<List<Integer>>> dynamicAoAoA = new ArrayList<List<List<Integer>>>()Dataclass with theint id,String linkattributes or something like that, then thisDataHolderclass (haven't found another name) that hasList<Data> lstDataattribute, then aBigDataHolderthat contains aList<DataHolder> lstDataHolderattribute, and on and on...