Java Collection Add add(Collection collection, T object)

Here you can find the source of add(Collection collection, T object)

Description

add

License

Apache License

Declaration

public static <T> void add(Collection<T> collection, T object) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.Collection;

public class Main {
    public static <T> void add(Collection<T> collection, T object) {
        collection.remove(object);/*from  w ww.  j a  v a2s .  co m*/
        collection.add(object);
    }
}

Related

  1. add(Collection c, Object o)
  2. add(Collection collection, T object)
  3. add_all(Collection target, Collection source)
  4. add_news(Collection target, Collection to_add)
  5. addAll(C collection, Iterable add)
  6. addAll(C collection, T... elements)