Here you can find the source of join(Collection
public static String join(Collection<String> collection)
//package com.java2s; /*/*from w w w . j a v a 2 s . c o m*/ * @(#)CollectionUtils.java 2013-4-3 ????23:33:33 * * Copyright (c) 2011-2013 Makersoft.org all rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * */ import java.util.Collection; public class Main { public static String join(Collection<String> collection) { if (collection != null && collection.size() != 0) { StringBuffer sb = new StringBuffer(); for (String item : collection) { sb.append(item); } return sb.toString(); } return null; } }