Here you can find the source of asList(Object[] array)
Parameter | Description |
---|---|
array | - Array of elements converted into list |
public static List asList(Object[] array)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.List; public class Main { /**/* ww w. j a v a 2 s . c o m*/ * Subtitution for Arrays.asList. <br> * This implementation return an editable list (sizable) an non thread-safe * @param array - Array of elements converted into list */ public static List asList(Object[] array) { ArrayList list = new ArrayList(); appendArrayToList(array, list); return list; } /** * Append the array's elements into the existing list. * @param array - Array of elements to be appended into the list * @param list - The target list */ public static void appendArrayToList(Object[] array, List list) { for (int i = 0; i < array.length; i++) { list.add(array[i]); } } }