MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

/*
 Output:
    
    
a
b
c
    
    
 * */

import java.util.*;

public class MainClass {
    public static void main(String args[]) {

        String[] a = new String[] { "a", "b", "c" };
        List list = Arrays.asList(a);

        Iterator i = list.iterator();
        while (i.hasNext()) {
            System.out.println(i.next());
        }
    }
}