Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.Collection;

import java.util.Set;
import java.util.TreeSet;

public class Main {

    public static <T> Set<T> listToSet(Collection<T> list) {
        Set<T> set = new TreeSet<T>();
        for (T t : list)
            set.add(t);
        return set;
    }
}