Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

public class Main {
    public static String join(Collection col, String delimiter) {
        StringBuilder builder = new StringBuilder();
        boolean firstItem = true;
        for (Object item : col) {
            if (!firstItem)
                builder.append(delimiter);
            else
                firstItem = false;

            builder.append(item);
        }
        return builder.toString();
    }
}