Here you can find the source of array2List(T... array)
Parameter | Description |
---|---|
array | a parameter |
public static <T> List<T> array2List(T... array)
//package com.java2s; //License from project: Apache License import java.util.Arrays; import java.util.List; public class Main { /**/*from w ww .j a v a 2 s .c om*/ * Convert array to List * * Example: * List<String> stooges = ArrayUtil.array2List("Larry", "Moe", "Curly"); * * @param array * @return */ public static <T> List<T> array2List(T... array) { return Arrays.asList(array); } }