Is there a simple way to convert double[][] to a String, showing all the values?
Arrays.deepToString does not work, because the inner values are double[], which creates a compilation error:
incompatible types: double[] cannot be converted to java.lang.Object[]
Arrays.toString will compile, but the resulting string is something like [[D@64c25a62, [D@43e8f1c], which is not very useful.
I think the most concise solution is something like
Arrays.stream(a).
map(Arrays::toString).
collect(Collectors.joining("[", "," "]"))
which isn't exactly concise.
Is there something better?
EDIT
Actually, Arrays.deepToString does do what I want. The error I was seeing that I thought mean it didn't work was from trying to pass a double[] to deepToString
double[]toArrays#deepToString, but that should be passed toArrays#toString. Adouble[][]will be correctly handled byArrays#deepToString(tested against Java 8 and 17), where it will pass the nested arrays toArray#toString. Can you show an example array you are attempting this with?