MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class MainClass {
    public static void main(String[] a) {
        Collection c = new ArrayList();
        c.add("1");
        c.add("2");
        c.add("3");
        Iterator i = c.iterator();
        while (i.hasNext()) {
            System.out.println(i.next());
        }
    }
}