Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.*;

public class Main {
    public static String join(Collection<?> coll, String delimiter) {
        if (coll.isEmpty()) {
            return "";
        }
        Iterator<?> it = coll.iterator();
        String s = String.valueOf(it.next());
        while (it.hasNext()) {
            s += delimiter;
            s += String.valueOf(it.next());
        }
        return s;
    }
}