Here you can find the source of join(Object[] objects)
public static String join(Object[] objects)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static String join(Object[] objects) { return join(objects, ""); }/*from www . j av a 2 s . co m*/ public static String join(Object[] objects, String separator) { StringBuilder builder = new StringBuilder(); int count = 0; for (Object object : objects) { if (count > 0) { builder.append(separator); } builder.append(object); count++; } return builder.toString(); } public static String join(List<?> objects, String separator) { return join(objects.toArray(), separator); } public static String toString(Object object) { return ((object == null) ? "null" : object.toString()); } }