Java List to Array toArray(final List list)

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

Description

to Array

License

Open Source License

Declaration

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

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.List;

public class Main {
    public static int[] toArray(final List<Integer> list) {
        final int n = list.size();
        final int[] array = new int[n];
        for (int i = 0; i < n; ++i) {
            array[i] = list.get(i);//from   w  w w.  j av a 2s. c  o m
        }
        return array;
    }
}

Related

  1. listToArray(List stringList)
  2. listToArray(List list)
  3. toArray(Collection list)
  4. toArray(Collection list)
  5. toArray(final List list)
  6. toArray(final List list)
  7. toArray(List list)
  8. toArray(List list)
  9. toArray(List list)