Java ArrayList to Array listToArray(ArrayList tempList)

Here you can find the source of listToArray(ArrayList tempList)

Description

list To Array

License

Apache License

Declaration

public static int[] listToArray(ArrayList<Integer> tempList) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;

public class Main {

    public static int[] listToArray(ArrayList<Integer> tempList) {
        if (tempList.size() == 0) {
            return null;
        }/*from ww w .j a v  a 2  s.  c  o  m*/
        int[] tempArray = new int[tempList.size()];
        for (int i = 0; i < tempList.size(); i++) {
            tempArray[i] = tempList.get(i);
        }
        return tempArray;
    }
}

Related

  1. convertArrayListToHexString(ArrayList al)
  2. convertArrayListToIntArray(ArrayList al)
  3. convertIntArrayList2array(ArrayList alInput)
  4. convertStringArrayListToArray(ArrayList al)
  5. doubleArrayList2Array(ArrayList a)
  6. listToIntArray(ArrayList list)
  7. toArray(ArrayList arrayList)
  8. toArray(ArrayList arrlist)
  9. toArray(ArrayList sigs)