Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import java.util.Iterator;

public class Main {
    public static String implode(Iterator it) {
        StringBuilder sb = new StringBuilder();
        while (it.hasNext()) {
            sb.append(it.next());
            sb.append(", ");
        }

        return sb.toString().replaceAll(", +$", "");
    }
}