LinkedHashSet: remove(Object o) : LinkedHashSet « java.util « Java by API






LinkedHashSet: remove(Object o)

 
import java.util.LinkedHashSet;

public class Main {

  public static void main(String[] args) {
    LinkedHashSet<Integer> lhashSet = new LinkedHashSet<Integer>();

    System.out.println("Size of LinkedHashSet : " + lhashSet.size());
    lhashSet.add(new Integer("1"));
    lhashSet.add(new Integer("2"));
    lhashSet.add(new Integer("3"));

    System.out.println(lhashSet.size());

    lhashSet.remove(new Integer("1"));

    System.out.println(lhashSet.size());
  }
}

   
  








Related examples in the same category

1.new LinkedHashSet()
2.LinkedHashSet: add(Integer e)
3.LinkedHashSet: isEmpty()
4.LinkedHashSet: iterator()
5.LinkedHashSet: size()
6.LinkedHashSet: toArray()