Java Collection Union union(Collection c1, Collection c2)

Here you can find the source of union(Collection c1, Collection c2)

Description

union

License

Open Source License

Declaration

@SuppressWarnings({ "rawtypes", "unchecked" })
public static List union(Collection c1, Collection c2) 

Method Source Code


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

import java.util.Collection;
import java.util.List;

public class Main {

    @SuppressWarnings({ "rawtypes", "unchecked" })
    public static List union(Collection c1, Collection c2) {
        List collection = new ArrayList();
        collection.addAll(c1);//www . ja v  a 2s .c  om
        collection.addAll(c2);
        return collection;
    }
}

Related

  1. union(Collection coll)
  2. union(Collection collection1, Collection collection2)
  3. union(Collection c1, Collection c2)
  4. union(Collection> sets)