Android examples for java.lang:Array Element
Returns a List of the objects in the specified array.
//package com.java2s; import java.util.ArrayList; import java.util.List; public class Main { /**/*www. j av a2s .com*/ * Returns a {@code List} of the objects in the specified array. * * @param array the array. * @return a {@code List} of the elements of the specified array. */ public static <T> List<T> asList(T[] array) { List<T> list = new ArrayList<T>(); for (T object : array) { list.add(object); } return list; } }