Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

public class Main {
    static <E> List<E> distinct(List<E> elements) {
        //TODO Implement me
        List<E> value = new ArrayList<>();
        for (E element : elements) {
            if (!value.contains(element)) {
                value.add(element);
            }
        }
        return value;
    }
}