Here you can find the source of addArrayToList(String[] array, List
private static void addArrayToList(String[] array, List<String> list)
//package com.java2s; /******************************************************************************* * Copyright (c) 2004, 2007 Actuate Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors://w w w. ja v a2s. co m * Actuate Corporation - initial API and implementation *******************************************************************************/ import java.util.List; public class Main { private static void addArrayToList(String[] array, List<String> list) { for (int i = 0; i < array.length; i++) { list.add(array[i]); } } }