MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class MainClass {

    public static void main(String[] args) {
        List myList = new ArrayList();
        myList.add("Hello");
        myList.add("World");
        myList.add("World");
        Set set = new HashSet(myList);

        System.out.println(set);
    }

}