Here you can find the source of convertArrayListToIntArray(ArrayList
public static int[] convertArrayListToIntArray(ArrayList<Integer> al)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static int[] convertArrayListToIntArray(ArrayList<Integer> al) { int[] list = new int[al.size()]; for (int i = 0; i < al.size(); i++) list[i] = al.get(i);// w w w . j ava 2 s. c o m return list; } }