Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

public class Main {

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

        System.out.println(set);
    }

}