Here you can find the source of toString(int[][] a)
public static String toString(int[][] a)
//package com.java2s; import java.util.*; public class Main { public static String toString(int[][] a) { StringBuilder result = new StringBuilder("["); for (int i = 0; i < a.length; i++) { result.append(Arrays.toString(a[i])); if (i < a.length - 1) result.append(','); }// w ww . j av a 2 s . com result.append(']'); return result.toString(); } public static String toString(double[][] b) { StringBuilder result = new StringBuilder("["); for (int i = 0; i < b.length; i++) { result.append(Arrays.toString(b[i])); if (i < b.length - 1) result.append(','); } result.append(']'); return result.toString(); } public static String toString(boolean[][] b) { StringBuilder result = new StringBuilder("["); for (int i = 0; i < b.length; i++) { result.append(Arrays.toString(b[i])); if (i < b.length - 1) result.append(','); } result.append(']'); return result.toString(); } }