Here you can find the source of arrayToString(T[] array)
public static <T> String arrayToString(T[] array)
//package com.java2s; //License from project: Apache License public class Main { public static <T> String arrayToString(T[] array, String splitter) { if (array == null) return null; if (array.length == 0) return ""; StringBuilder stringBuilder = new StringBuilder(array[0].toString()); for (int i = 1; i < array.length; i++) { stringBuilder.append(splitter); stringBuilder.append(array[i]); }// w w w . j ava 2s . c om return stringBuilder.toString(); } public static <T> String arrayToString(T[] array) { return arrayToString(array, ", "); } }