Here you can find the source of join(String[] array, String sep)
public static String join(String[] array, String sep)
//package com.java2s; import java.util.Arrays; import java.util.List; public class Main { public static String join(String[] array, String sep) { return join(Arrays.asList(array), sep); }//w ww . j a v a 2s . c o m public static String join(List<String> array, String sep) { StringBuilder sb = new StringBuilder(); for (String arg : array) { if (sb.length() > 0) { sb.append(sep); } sb.append(arg); } return sb.toString(); } }