Example usage for java.util HashSet HashSet

List of usage examples for java.util HashSet HashSet

Introduction

In this page you can find the example usage for java.util HashSet HashSet.

Prototype

public HashSet(int initialCapacity, float loadFactor) 

Source Link

Document

Constructs a new, empty set; the backing HashMap instance has the specified initial capacity and the specified load factor.

Usage

From source file:Main.java

public static void main(String args[]) {
    HashSet<String> hs = new HashSet<String>(20, 0.75F);

    hs.add("java2s.com");
    hs.add("j a v a2s.com");

    System.out.println(hs);/*w w w.  j a  v  a  2  s. c  o  m*/
}