I have a String which contains arrays. Example:
\"[[1, 2], [4, 5], [7, 8]]\"
Now, I want to make an actual Java array out of this. I have c
If you are doing numeric work then you should probably use a library. For example my open source library Vectorz provides proper support for multidimensional arrays / matrices (with doubles).
Then you can just do something like:
INDArray m=Arrayz.parse("[[1, 2], [4, 5], [7, 8]]");
The INDArray object encapsulates all the multidimensionality so you don't need to worry about writing big nested loops all the time, plus it provides a lot of other functions and capabilities that normal Java arrays don't have.