Java List to Array toArray(List list)

Here you can find the source of toArray(List list)

Description

Returns the given list as a String[].

License

Open Source License

Parameter

Parameter Description
list a list to transform.

Return

the given list as a String[].

Declaration

private static String[] toArray(List list) 

Method Source Code

//package com.java2s;
/*//w  w w .  j  a  v a 2 s  .c  o m
 * Copyright (c) 2007-2016 AREasy Runtime
 *
 * This library, AREasy Runtime and API for BMC Remedy AR System, is free software ("Licensed Software");
 * you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either version 2.1 of the License,
 * or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * including but not limited to, the implied warranty of MERCHANTABILITY, NONINFRINGEMENT,
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
 */

import java.util.*;

public class Main {
    /**
     * Returns the given list as a <code>String[]</code>.
     *
     * @param list a list to transform.
     * @return the given list as a <code>String[]</code>.
     */
    private static String[] toArray(List list) {
        return (String[]) list.toArray(new String[list.size()]);
    }
}

Related

  1. toArray(final List list)
  2. toArray(final List list)
  3. toArray(List list)
  4. toArray(List list)
  5. toArray(List list)
  6. toArray(List list, Object array[], int start, int end)
  7. toArray(List lista)
  8. toArray(List list)
  9. toArray(List data)