Here you can find the source of joinArray(List
public static <T> String joinArray(List<T> list, String separator)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { /**// w w w . j av a 2 s. co m * Transforms list into a string. It joins the elements of the list with the given separator. */ public static <T> String joinArray(List<T> list, String separator) { StringBuilder result = new StringBuilder(); boolean first = true; for (T element : list) { if (first) { first = false; } else { result.append(separator); } result.append(element); } return result.toString(); } }