Here you can find the source of convertToList(String[] array)
Parameter | Description |
---|---|
array | The string array to convert |
public static List<String> convertToList(String[] array)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.Collections; import java.util.List; public class Main { /**//from w w w.j ava2s .c o m * A method to convert a String array to a List of Strings * * @param array The string array to convert * @return A ArrayList containing the array elements */ public static List<String> convertToList(String[] array) { ArrayList<String> list = new ArrayList<String>(); Collections.addAll(list, array); return list; } }