Java ArrayList to Array toIntArray(ArrayList array)

Here you can find the source of toIntArray(ArrayList array)

Description

to Int Array

License

Open Source License

Declaration

public static int[] toIntArray(ArrayList<Integer> array) 

Method Source Code


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

import java.util.ArrayList;

public class Main {
    public static int[] toIntArray(ArrayList<Integer> array) {
        Integer[] temp = new Integer[array.size()];
        int[] out = new int[array.size()];
        temp = array.toArray(temp);/*from ww w . jav  a 2  s  .  c  o  m*/
        for (int i = 0; i < array.size(); i++) {
            out[i] = temp[i];
        }
        return out;
    }
}

Related

  1. toArray(ArrayList arrlist)
  2. toArray(ArrayList sigs)
  3. toBooleanArray(ArrayList items)
  4. toByteArray(ArrayList in)
  5. toIntArray(ArrayList list)
  6. toIntArray(ArrayList array)
  7. toIntArray(ArrayList input)
  8. toStringArr(ArrayList al)
  9. toStringArray(ArrayList src)