java 2d array print column code example
Example 1: print 2d array in java
int[][] array = new int[rows][columns];
System.out.println(Arrays.deepToString(array));
Example 2: java print 2d array as table
static void debugV2(Object... obj) {
System.out.println(Arrays.deepToString(obj)
.replace("],", "\n").replace(",", "\t")
.replaceAll("[\\[\\]]", " "));
}
static void debug(Object... obj) {
System.err.println(Arrays.deepToString(obj).replace("], ", "]\n"));
}