Java List from Array convertArrayToList(String[] array)

Here you can find the source of convertArrayToList(String[] array)

Description

Convert array to list of objects.

License

Open Source License

Parameter

Parameter Description
array a parameter

Declaration

public static ArrayList<String> convertArrayToList(String[] array) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;

public class Main {
    /**/*from  w  ww . j a  va  2s .  com*/
     * Convert array to list of objects.
     * 
     * @param array
     * @return
     */
    public static ArrayList<String> convertArrayToList(String[] array) {
        ArrayList<String> elemList = new ArrayList<String>();
        for (String element : array) {
            elemList.add(element);
        }
        return elemList;
    }
}

Related

  1. convertArrayToList(List list, String[] strs)
  2. convertArrayToList(Object value)
  3. convertArrayToList(Object[] objects)
  4. convertArrayToList(Object[] source)
  5. convertArrayToList(String[] array)
  6. convertArrayToList(String[] arrayStr)
  7. convertArrayToList(T... objects)
  8. convertArrayToList(T[] array)
  9. convertArrayToList(T[] arrayOfObjects)