Java List from Array array2list(String[] array)

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

Description

arraylist

License

Apache License

Declaration

public static List<String> array2list(String[] array) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;
import java.util.List;

public class Main {
    public static List<String> array2list(String[] array) {
        List<String> list = new ArrayList<>(array.length);
        for (String value : array) {
            list.add(value);//from w  w  w.j a  v a 2  s  .  c o m
        }
        return list;
    }
}

Related

  1. array2ArrayList(final T[] array)
  2. array2List(Object[] obj)
  3. array2List(T... array)
  4. arrayAsArrayList(E... elements)
  5. arrayAsList(Object value)
  6. arrayAsList(Object[] array)