Java HashSet Create newHashSet(E... elements)

Here you can find the source of newHashSet(E... elements)

Description

new Hash Set

License

Open Source License

Declaration

public static <E> HashSet<E> newHashSet(E... elements) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Collections;

import java.util.HashSet;

public class Main {
    public static <E> HashSet<E> newHashSet(E... elements) {
        HashSet<E> set = new HashSet<>(elements.length);
        Collections.addAll(set, elements);
        return set;
    }/*from   www.  j  a va 2  s  .c o m*/
}

Related

  1. hashSetOf(T... elements)
  2. hashSetOf(T... ts)
  3. identityHashSet()
  4. isValidTagException(HashSet tagExceptions, String buffer)
  5. newHashSet(boolean optimized, T... array)
  6. newHashSet(E... elements)
  7. newHashSet(E... elements)
  8. newHashSetOnNull(Set set)
  9. print_bigrams(HashSet bigrams)