Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static String toString(Iterable<?> iterable) {
        if (iterable == null)
            throw new IllegalArgumentException();

        StringBuilder sb = new StringBuilder();

        for (Object value : iterable) {
            if (sb.length() > 0) {
                sb.append(", ");
            }

            sb.append(value);
        }

        return sb.toString();
    }
}