Here you can find the source of toArrayList(String[] ss)
public static List<String> toArrayList(String[] ss)
//package com.java2s; /******************************************************************************* * Copyright (c) 2011 Dipanjan Das //from w w w .j a v a2s . c om * Language Technologies Institute, * Carnegie Mellon University, * All Rights Reserved. * * ArrayUtil.java is part of SEMAFOR 2.0. * * SEMAFOR 2.0 is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * SEMAFOR 2.0 is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with SEMAFOR 2.0. If not, see <http://www.gnu.org/licenses/>. ******************************************************************************/ import java.util.ArrayList; import java.util.List; public class Main { public static List<Integer> toArrayList(int[] ii) { List<Integer> list = new ArrayList<Integer>(); for (int i : ii) list.add(i); return list; } public static List<String> toArrayList(String[] ss) { List<String> list = new ArrayList<String>(); for (String s : ss) list.add(s); return list; } }