Here you can find the source of printArray(Object[] in)
public static final String printArray(Object[] in)
//package com.java2s; //License from project: Apache License public class Main { public static final String printArray(Object[] in) { if (in == null) return "null"; String out = ""; for (int i = 0; i < in.length; i++) { out += in[i].toString() + " ; "; }/*from ww w . ja v a 2s .c om*/ return out; } public static final String printArray(String[] in) { if (in == null) return "null"; String out = ""; for (int i = 0; i < in.length; i++) { out += in[i] + " ; "; } return out; } public static final String printArray(boolean[] in) { if (in == null) return "null"; String out = ""; for (int i = 0; i < in.length; i++) { if (in[i]) out += "1 ; "; else out += "0 ; "; } return out; } public static final String printArray(byte[] in) { if (in == null) return "null"; String out = ""; for (int i = 0; i < in.length; i++) { out += in[i] + " "; } return out; } public static final String printArray(float[] in) { if (in == null) return "null"; String out = ""; for (int i = 0; i < in.length; i++) { out += in[i] + " "; } return out; } public static final String printArray(double[] in) { if (in == null) return "null"; String out = ""; for (int i = 0; i < in.length; i++) { out += in[i] + " "; } return out; } public static final String printArray(int[] in) { if (in == null) return "null"; String out = ""; for (int i = 0; i < in.length; i++) { out += in[i] + " "; } return out; } public static final String printArray(long[] in) { if (in == null) return "null"; String out = ""; for (int i = 0; i < in.length; i++) { out += in[i] + " "; } return out; } public static final String printArray(boolean[][] in) { if (in == null) return "null"; String out = ""; for (int i = 0; i < in.length; i++) { for (int j = 0; j < in[0].length; j++) { if (in[i][j]) out += "1 "; else out += "0 "; } out += "\n"; } return out; } public static final String printArray(byte[][] in) { if (in == null) return "null"; String out = ""; for (int i = 0; i < in.length; i++) { for (int j = 0; j < in[0].length; j++) { out += in[i][j] + " "; } out += "\n"; } return out; } public static final String printArray(float[][] in) { if (in == null) return "null"; String out = ""; for (int i = 0; i < in.length; i++) { for (int j = 0; j < in[0].length; j++) { out += in[i][j] + " "; } out += "\n"; } return out; } public static final String printArray(int[][] in) { if (in == null) return "null"; String out = ""; for (int i = 0; i < in.length; i++) { for (int j = 0; j < in[0].length; j++) { out += in[i][j] + " "; } out += "\n"; } return out; } public static final String printArray(double[][] in) { return printArray(in, " ", "\n"); } public static final String printArray(double[][] in, String colsep, String rowsep) { if (in == null) return "null"; String out = ""; for (int i = 0; i < in.length; i++) { for (int j = 0; j < in[0].length; j++) { out += in[i][j] + colsep; } out += rowsep; } return out; } public static final String printArray(float[][][] in) { if (in == null) return "null"; String out = ""; for (int k = 0; k < in[0][0].length; k++) { for (int i = 0; i < in.length; i++) { for (int j = 0; j < in[0].length; j++) { out += in[i][j][k] + " "; } out += "\n"; } out += "****************\n"; } return out; } public static final String printArray(boolean[][][] in) { if (in == null) return "null"; String out = ""; for (int k = 0; k < in[0][0].length; k++) { for (int i = 0; i < in.length; i++) { for (int j = 0; j < in[0].length; j++) { out += in[i][j][k] + " "; } out += "\n"; } out += "****************\n"; } return out; } public static final String printArray(int[][][] in) { if (in == null) return "null"; String out = ""; for (int k = 0; k < in[0][0].length; k++) { for (int i = 0; i < in.length; i++) { for (int j = 0; j < in[0].length; j++) { out += in[i][j][k] + " "; } out += "\n"; } out += "****************\n"; } return out; } public static final String printArray(double[][][] in) { if (in == null) return "null"; String out = ""; for (int k = 0; k < in[0][0].length; k++) { for (int i = 0; i < in.length; i++) { for (int j = 0; j < in[0].length; j++) { out += in[i][j][k] + " "; } out += "\n"; } out += "****************\n"; } return out; } public static final String[] toString(double[] a) { String[] b = new String[a.length]; for (int i = 0; i < a.length; i++) { b[i] = Double.toString(a[i]); } return b; } public static final String[] toString(float[] a) { String[] b = new String[a.length]; for (int i = 0; i < a.length; i++) { b[i] = Float.toString(a[i]); } return b; } }