Here you can find the source of getArrayList(String[] args)
public static ArrayList getArrayList(String[] args)
//package com.java2s; /******************************************************************************* * Copyright (c) 2004, 2011 IBM Corporation and others. * 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 * //from ww w . j a v a 2 s. c om * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ import java.util.ArrayList; public class Main { public static ArrayList getArrayList(String[] args) { if (args == null) { return null; } // We could be using Arrays.asList() here, but it does not specify // what kind of list it will return. We need a list that // implements the method List.remove(Object) and ArrayList does. ArrayList result = new ArrayList(args.length); for (int i = 0; i < args.length; i++) { result.add(args[i]); } return result; } }