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.Enumeration;

public class Main {
    public static String enumerationToString(Enumeration enm) {
        StringBuffer sb = new StringBuffer(100);
        boolean firstItem = true;
        sb.append("[");
        while (enm.hasMoreElements()) {
            if (!firstItem) {
                sb.append(", ");
            }
            sb.append(enm.nextElement());
            firstItem = false;
        }
        sb.append("]");
        return sb.toString();
    }
}