Java Array to ArrayList toArrayList(String[] ss)

Here you can find the source of toArrayList(String[] ss)

Description

to Array List

License

Open Source License

Declaration

public static List<String> toArrayList(String[] ss) 

Method Source Code

//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;
    }
}

Related

  1. toArrayList(int[] p)
  2. toArrayList(int[] values)
  3. toArrayList(List list)
  4. toArrayList(Object pObject)
  5. toArrayList(String str)
  6. toArrayList(T... items)
  7. toArrayList(T[] vals)
  8. toArrayListArr(ArrayList al)
  9. toByteArrayList(byte[] list)