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

public class Main {
    private static <T> boolean removeAllFromArrayList(ArrayList<T> collection, Collection<?> toRemove) {
        boolean result = false;
        for (int i = collection.size(); --i >= 0;)
            if (toRemove.contains(collection.get(i))) {
                collection.remove(i);
                result = true;
            }
        return result;
    }
}