Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

import java.util.List;

public class Main {

    public static <T> List<T> uiqList(List<T> list) {
        if (list == null) {
            return list;
        }

        List<T> tList = new ArrayList<T>(list.size());
        for (T t : list) {
            if (!tList.contains(t)) {
                tList.add(t);
            }
        }
        return tList;
    }
}