Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.Iterator;
import java.util.Vector;

public class Main {

    public static void main(String[] arguments) {
        String[] codes = { "alpha", "lambda", "gamma", "delta", "zeta" };

        Vector list = new Vector();

        for (int i = 0; i < codes.length; i++) {
            if (!list.contains(codes[i])) {
                list.add(codes[i]);
            }
        }
        for (Iterator ite = list.iterator(); ite.hasNext();) {
            String output = (String) ite.next();
            System.out.println(output);
        }
    }
}