Here you can find the source of join(Object[] array)
public static String join(Object[] array)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static String join(List<?> list) { return join(list.toArray()); }/*from w ww . j a va 2s .c om*/ public static String join(List<?> list, String separator) { return join(list.toArray(), separator); } public static String join(Object[] array) { return join(array, ", "); } public static String join(Object[] array, String separator) { if (array.length == 0) return ""; String result = array[0].toString(); for (int index = 1; index < array.length; index++) result += separator + array[index]; return result; } }