Java tutorial
//package com.java2s; public class Main { public static void print(String a[][]) { if (a != null) { StringBuffer result = new StringBuffer("Array printer:"); for (int i = 0; i < a.length; i++) { result.append("\n").append(i).append(":"); for (int j = 0; j < a[i].length; j++) result.append(" [").append(a[i][j]).append("]"); } //System.out.println(result.toString()); } else { //System.out.println("Array printer: null"); } } }