Java Array to List newList(T... objs)

Here you can find the source of newList(T... objs)

Description

new List

License

Open Source License

Declaration

@SafeVarargs
    public static <T> List<T> newList(T... objs) 

Method Source Code


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

import java.util.*;

public class Main {
    @SafeVarargs
    public static <T> List<T> newList(T... objs) {
        List<T> result = new ArrayList<>(objs.length);
        Collections.addAll(result, objs);
        return result;
    }/* w ww  .  j  a va 2  s  . c  om*/
}

Related

  1. newList(T... elements)
  2. newList(T... elements)
  3. newList(T... items)
  4. newList(T... list)
  5. newList(T... objects)
  6. newList(T... ts)
  7. newList(T... values)
  8. newList(V... items)
  9. toList(@SuppressWarnings("unchecked") T... ts)