Java ArrayList to Array toArray(ArrayList arrlist)

Here you can find the source of toArray(ArrayList arrlist)

Description

to Array

License

Open Source License

Declaration

static public int[] toArray(ArrayList<Integer> arrlist) 

Method Source Code


//package com.java2s;
import java.util.ArrayList;

public class Main {
    static public int[] toArray(ArrayList<Integer> arrlist) {
        int[] arr = new int[arrlist.size()];

        for (int i = 0; i < arrlist.size(); i++)
            arr[i] = arrlist.get(i);/* ww  w.  ja  v  a  2  s. c  o m*/

        return arr;
    }
}

Related

  1. convertStringArrayListToArray(ArrayList al)
  2. doubleArrayList2Array(ArrayList a)
  3. listToArray(ArrayList tempList)
  4. listToIntArray(ArrayList list)
  5. toArray(ArrayList arrayList)
  6. toArray(ArrayList sigs)
  7. toBooleanArray(ArrayList items)
  8. toByteArray(ArrayList in)
  9. toIntArray(ArrayList list)