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;

public class Main {
    public static void main(String args[]) {
        List<String> list = new ArrayList<>();
        list.add("java2s.com");
        list.add("java2s.com");
        list.add("java2s.com");

        HashSet<String> hs = new HashSet<String>(list);

        System.out.println(hs);
    }
}