Java Set Create asSet(T... elements)

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

Description

as Set

License

Open Source License

Declaration

public static <T> Set<T> asSet(T... elements) 

Method Source Code

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

import java.util.*;

public class Main {
    public static <T> Set<T> asSet(T... elements) {
        return asLinkedSet(elements);
    }//from   ww w . j a v  a  2s  .  co  m

    public static <T> LinkedHashSet<T> asLinkedSet(T... elements) {
        LinkedHashSet<T> set = new LinkedHashSet<>();
        for (T element : elements) {
            set.add(element);
        }
        return set;
    }
}

Related

  1. asSet(T... array)
  2. asSet(T... array)
  3. asSet(T... array)
  4. asSet(T... element)
  5. asSet(T... elements)
  6. asSet(T... elements)
  7. asSet(T... items)
  8. asSet(T... ts)
  9. asSet(T... ts)