Here you can find the source of join(String[]... arrays)
public static String[] join(String[]... arrays)
//package com.java2s; //License from project: Open Source License public class Main { public static String[] join(String[]... arrays) { // calculate size of target array int size = 0; for (String[] array : arrays) { size += array.length;//from w w w.j a va 2 s. com } // create list of appropriate size java.util.List<String> list = new java.util.ArrayList<String>(size); // add arrays for (String[] array : arrays) { list.addAll(java.util.Arrays.asList(array)); } // create and return final array return list.toArray(new String[size]); } }