Here you can find the source of printarray(final int[] a)
public static void printarray(final int[] a)
//package com.java2s; //License from project: Open Source License public class Main { public static void printarray(final int[] a) { StringBuilder s = new StringBuilder(); for (int i : a) { s.append(i);//w ww .j a v a2 s.co m s.append(", "); } if (s.length() >= 1) { s.deleteCharAt(s.length() - 1); } s.append("\n"); System.err.print(s.toString()); } public static void printarray(final boolean[] a) { StringBuilder s = new StringBuilder(); for (boolean i : a) { s.append(i); s.append(", "); } if (s.length() >= 1) { s.deleteCharAt(s.length() - 1); } s.append("\n"); System.err.print(s.toString()); } public static void printarray(final double[] a) { StringBuilder s = new StringBuilder(); for (double i : a) { s.append(i); s.append(", "); } if (s.length() >= 1) { s.deleteCharAt(s.length() - 1); } s.append("\n"); System.err.print(s.toString()); } public static void printarray(final float[] a) { StringBuilder s = new StringBuilder(); for (float i : a) { s.append(i); s.append(", "); } if (s.length() >= 1) { s.deleteCharAt(s.length() - 1); } s.append("\n"); System.err.print(s.toString()); } public static void printarray(final Object[] a) { StringBuilder s = new StringBuilder(); for (Object i : a) { s.append(i.toString()); s.append(", "); } if (s.length() >= 1) { s.deleteCharAt(s.length() - 1); } s.append("\n"); System.err.print(s.toString()); } }