Create and use LinkedHashSet - Java Collection Framework

Java examples for Collection Framework:LinkedHashSet

Description

Create and use LinkedHashSet

Demo Code

 
import java.util.LinkedHashSet;
 
public class Main {
 
  public static void main(String[] args) {
    LinkedHashSet lhashSet = new LinkedHashSet();
    lhashSet.add(new Integer("1"));
    lhashSet.add(new Integer("2"));
    lhashSet.add(new Integer("3"));
    System.out.println("LinkedHashSet contains.." + lhashSet);  
  }/*from w ww .j av a2  s.c om*/
}

Result


Related Tutorials