Here you can find the source of toIntArray(ArrayList
Parameter | Description |
---|---|
input | An Integer ArrayList |
public static int[] toIntArray(ArrayList<Integer> input)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; public class Main { /**// w ww .j a v a2s .c om * Convert an ArrayList to a simple Array * @param input An Integer ArrayList * @return A simple Int Array */ public static int[] toIntArray(ArrayList<Integer> input) { int len = input.size(); int[] output = new int[len]; for (int i = 0; i < len; i++) { output[i] = input.get(i); } return output; } }