Here you can find the source of newList(V... items)
Parameter | Description |
---|---|
V | a parameter |
items | a parameter |
public static <V> List<V> newList(V... items)
//package com.java2s; import java.util.ArrayList; import java.util.List; public class Main { /**/*from www . ja v a 2 s . co m*/ * Returns a new list containing the given items. * * @param <V> * @param items * @return */ public static <V> List<V> newList(V... items) { List<V> list = new ArrayList<V>(); for (V item : items) { list.add(item); } return list; } }