LinkedHashSet: isEmpty() : LinkedHashSet « java.util « Java by API






LinkedHashSet: isEmpty()

 

       
import java.util.LinkedHashSet;

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

    lhashSet.add(new Integer("1"));
    lhashSet.add(new Integer("2"));
    lhashSet.add(new Integer("3"));

    System.out.println(lhashSet);

    lhashSet.clear();

    System.out.println(lhashSet);

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

   
  








Related examples in the same category

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