Java ArrayList to Array toStringArrayList(final Object... array)

Here you can find the source of toStringArrayList(final Object... array)

Description

to String Array List

License

Open Source License

Parameter

Parameter Description
array The elements to be included in the returned ArrayList

Return

An ArrayList containing the String representation of the elements passed in via the array parameter

Declaration

public static ArrayList<String> toStringArrayList(final Object... array) 

Method Source Code


//package com.java2s;
import java.util.ArrayList;

public class Main {
    /**//from w w  w  . ja  v  a2s  .  co  m
     * @param array The elements to be included in the returned ArrayList
     * @return An ArrayList containing the String representation of the elements passed in via the array parameter
     */
    public static ArrayList<String> toStringArrayList(final Object... array) {
        final ArrayList<String> retValue = new ArrayList<String>();
        for (final Object item : array)
            retValue.add(item.toString());
        return retValue;
    }
}

Related

  1. toIntArray(ArrayList array)
  2. toIntArray(ArrayList input)
  3. toStringArr(ArrayList al)
  4. toStringArray(ArrayList src)
  5. toStringArray(ArrayList src)