Here you can find the source of array2String(T... array)
public static <T> String array2String(T... array)
//package com.java2s; //License from project: Apache License public class Main { public static <T> String array2String(T... array) { int len = array.length; if (len == 0) { return ""; }/*from w w w. j av a 2 s. c o m*/ StringBuilder sb = new StringBuilder(); sb.append("[").append(array[0]); for (int i = 1; i < array.length; i++) { sb.append(",").append(array[i]); } sb.append("]"); return sb.toString(); } }