List to int[] : Integer « Date Type « Android

List to int[]

import java.util.List;

class Main {
  public   static int[] toArray(List<Integer> src) {
    int[] res = new int[src.size()];
    for (int i = 0; i < src.size(); i++) {
      res[i] = src.get(i);
    return res;


Related examples in the same category

1.Integer To One Byte
2.Integer To Two Bytes
3.Integer To Four Bytes
4.One Byte To Integer
5.Two Bytes To Integer
6.Tests if an integer is power of two
7.Convert an integer value to its byte array representation
8.Convert a byte array integer (4 bytes) to its int value
9.Convert a byte array representing an unsigned integer (4bytes) to its long value
10.fahrenheit To Celsius, celsius To Fahrenheit
11.Padding Int value