Here you can find the source of createListWithArray(Object[] array)
Parameter | Description |
---|---|
array | Object[] |
public static List<Object> createListWithArray(Object[] array)
//package com.java2s; import java.util.ArrayList; import java.util.List; public class Main { /**//from w ww. j av a2s . c om * Create a new array list with input array. * * @param array Object[] * @return List */ public static List<Object> createListWithArray(Object[] array) { final ArrayList<Object> result = new ArrayList<Object>(); if (array == null) { return result; } for (Object obj : array) { result.add(obj); } return result; } }