Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

public class Main {
    public static void main(String[] args) {
        String[] array = { "A", "B", "C", "D" };
        List list = Arrays.asList(array);

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