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






new LinkedHashSet()

  


import java.util.LinkedHashSet;
import java.util.Set;

public class Main {

  public static Set fill(Set a, int size) {
    for (int i = 0; i < size; i++)
      a.add(new Integer(i));
    return a;
  }

  public static void test(Set a) {
    fill(a, 10);
    System.out.println(a);
  }

  public static void main(String[] args) {
    test(new LinkedHashSet());
  }
}

   
    
  








Related examples in the same category

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