Java HashSet Create hashSetOf(T... elements)

Here you can find the source of hashSetOf(T... elements)

Description

hash Set Of

License

Open Source License

Declaration

@SafeVarargs
    public static <T> Set<T> hashSetOf(T... elements) 

Method Source Code

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

import java.util.*;

public class Main {
    @SafeVarargs
    public static <T> Set<T> hashSetOf(T... elements) {
        HashSet<T> set = new HashSet<>();
        for (T element : elements) {
            set.add(element);/*from   w  w  w  .  ja  v a  2  s.  c om*/
        }
        return set;
    }
}

Related

  1. createHashSet(T... arr)
  2. hashSet()
  3. hashSet()
  4. hashset_to_int_array(Set hs)
  5. hashSetFromArray(final T[] objs)
  6. hashSetOf(T... ts)
  7. identityHashSet()
  8. isValidTagException(HashSet tagExceptions, String buffer)
  9. newHashSet(boolean optimized, T... array)