Java tutorial
//package com.java2s; import java.util.Arrays; public class Main { public static String toString(int X[][]) { StringBuffer res = new StringBuffer("{"); for (int row[] : X) { if (row != X[0]) { res.append(", "); } res.append(Arrays.toString(row)); } res.append("}"); return res.toString(); } }