Here you can find the source of arrayToString(T[] array)
public static <T> String arrayToString(T[] array)
//package com.java2s; public class Main { public static <T> String arrayToString(T[] array) { if (array != null) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < array.length; i++) { Object object = (Object) array[i]; builder.append(String.valueOf(object)); if (i < array.length - 1) { builder.append(", "); }//from www . j a v a2s . c o m } return builder.toString(); } else { return "" + null; } } }