Here you can find the source of implode(String glue, T[] array)
public static <T> String implode(String glue, T[] array)
//package com.java2s; //License from project: Apache License public class Main { public static <T> String implode(String glue, T[] array) { // array is empty, return empty string if (array == null || array.length == 0) { return ""; }//w w w.j a va 2s. c o m // init the builder with the first element StringBuilder sb = new StringBuilder(); sb.append(array[0]); // concat each element // begin at 1 to avoid duplicating first element for (int i = 1; i < array.length; i++) { sb.append(glue).append(array[i]); } // return the result return sb.toString(); } }