Here you can find the source of toIntegerArray(List
Parameter | Description |
---|---|
values | the list of instances of class Integer |
public static int[] toIntegerArray(List<Integer> values)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { /**// w w w .j a v a2s.c o m * Creates an array of type int[] from a list of instances of class Integer. * @param values the list of instances of class Integer * @return the array of type int[] containing the values from the given list */ public static int[] toIntegerArray(List<Integer> values) { int ret[] = new int[values.size()]; for (int i = 0; i < ret.length; i++) ret[i] = values.get(i); return ret; } }