Here you can find the source of toIntArray(List
Parameter | Description |
---|---|
intList | the List<Integer> to convert to |
public static int[] toIntArray(List<Integer> intList)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { /**/*from w w w. j a va 2 s. com*/ * Convert a List<Integer> into the primitive type array * * @param intList the List<Integer> to convert to * @return a converted array of int primitive type */ public static int[] toIntArray(List<Integer> intList) { assert intList != null; if (intList == null) { return null; } int[] ints = new int[intList.size()]; for (int i = 0; i < intList.size(); i++) { ints[i] = intList.get(i); } return ints; } }