Java List to Array toArray(List list)

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

Description

convert a Vector of String into a String[]

License

Open Source License

Declaration

public static final String[] toArray(List list) 

Method Source Code


//package com.java2s;
/*/*www  . jav  a  2  s.  c  o  m*/
 * This file is part of the Jose Project
 * see http://jose-chess.sourceforge.net/
 * (c) 2002-2006 Peter Sch?fer
 *
 * This program 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 2 of the License, or
 * (at your option) any later version.
 *
 */

import java.util.*;

public class Main {
    /**
     * convert a Vector of String into a String[]
     */
    public static final String[] toArray(List list) {
        String[] result = new String[list.size()];
        list.toArray(result);
        return result;
    }
}

Related

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