Java List to Array convertToArray(List list)

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

Description

convert To Array

License

Open Source License

Declaration

public static int[] convertToArray(List<Integer> list) 

Method Source Code

//package com.java2s;
/*/* w w  w. j a v a2  s .c o m*/
 * Copyright (c) 2010, James Hanlon
 * All rights reserved.
 * 
 * Made available under the BSD license - see the LICENSE file
 */

import java.util.Iterator;
import java.util.List;

public class Main {
    public static int[] convertToArray(List<Integer> list) {
        int[] array = new int[list.size()];
        Iterator<Integer> iterator = list.iterator();

        for (int i = 0; i < array.length; i++)
            array[i] = iterator.next().intValue();

        return array;
    }
}

Related

  1. asByteArray(final List l)
  2. asClassArray(List> list)
  3. convertStringListToArray(List list)
  4. convertStringListToArray(List list)
  5. convertToArray(final List> list)
  6. convertToArray(List args)
  7. listToArray(final List list)
  8. listToArray(final List a)
  9. listToArray(List data)