Here you can find the source of array2String(T[] array, String splitFlag, boolean useBracket)
public static <T> String array2String(T[] array, String splitFlag, boolean useBracket)
//package com.java2s; //License from project: Apache License public class Main { public static <T> String array2String(T[] array, String splitFlag, boolean useBracket) { if (array != null && array.length == 0) { return null; }// w w w . java2 s . co m StringBuilder sb = new StringBuilder(); for (T t : array) { sb.append(t.toString() + splitFlag); } int sbLen = sb.length(); sb.delete(sbLen - 2, sbLen); if (useBracket) { sb.insert(0, '['); sb.append(']'); } return sb.toString(); } }