Here you can find the source of arrayToString(T[] ar)
public static <T> String arrayToString(T[] ar)
//package com.java2s; //License from project: Apache License public class Main { public static <T> String arrayToString(T[] ar) { StringBuilder sb = new StringBuilder("["); boolean first = true; for (Object o : ar) { if (!first) { sb.append(", "); }/* w w w. java 2s .co m*/ sb.append(o); first = false; } sb.append("]"); return sb.toString(); } }