Here you can find the source of deepToString(double[][] array)
public static String deepToString(double[][] array)
//package com.java2s; //License from project: Apache License public class Main { public static String deepToString(double[][] array) { StringBuilder sb = new StringBuilder(); sb.append("["); for (double[] arr : array) { sb.append("["); for (double a : arr) { sb.append(String.format("%10.3g, ", a)); }/*from w w w . j ava2s .c o m*/ sb.append("], "); } sb.append("]"); return sb.toString(); } public static String toString(double[] array, String formatString) { StringBuilder sb = new StringBuilder(); sb.append("{"); for (int i = 0; i < array.length; i++) { sb.append(String.format(formatString, array[i])); if (i < array.length - 1) { sb.append(", "); } } sb.append("}"); return sb.toString(); } }