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 {
    public static void deleteDuplicate(List<Integer> list) {
        List<Integer> tempList = new ArrayList<Integer>();

        Iterator<Integer> iter = list.iterator();
        while (iter.hasNext()) {
            Integer current = iter.next();
            if (tempList.contains(current)) {
                iter.remove();
            } else {
                tempList.add(current);
            }
        }
    }
}