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.Iterator;

public class Main {
    public static <T> boolean removeIdentity(Collection<T> c, T e) {
        for (Iterator<T> i = c.iterator(); i.hasNext();)
            if (i.next() == e) {
                i.remove();
                return true;
            }
        return false;
    }
}