Here you can find the source of join(List extends Object> items, String conjunction)
static public String join(List<? extends Object> items, String conjunction)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { /** String.join is available only with Java 1.8. We support 1.7. *//from w ww . j a v a 2s. co m * Format a list of items as strings, separated by the given conjunction. */ static public String join(List<? extends Object> items, String conjunction) { StringBuilder sb = new StringBuilder(); boolean first = true; for (Object x : items) { if (first) { first = false; } else { sb.append(conjunction); } if (x == null) { sb.append("<null>"); } else { sb.append(x.toString()); } } return sb.toString(); } }