Java List to Int List toIntArray(List list)

Here you can find the source of toIntArray(List list)

Description

to Int Array

License

Open Source License

Declaration

public static int[] toIntArray(List<Integer> list) 

Method Source Code

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

import java.util.List;

public class Main {
    public static int[] toIntArray(List<Integer> list) {
        try {//from w  w  w  .  jav a  2 s.  co m
            int[] ret = new int[list.size()];

            for (int i = 0; i < ret.length; i++) {
                ret[i] = list.get(i).intValue();
            }

            return ret;
        } catch (NullPointerException e) {
            return null;
        }
    }
}

Related

  1. toIntArray(List list)
  2. toIntArray(List list)
  3. toIntArray(List list)
  4. toIntArray(List list)
  5. toIntArray(List list)
  6. toIntArray(List list)
  7. toIntArray(List list)
  8. toIntArray(List list)
  9. toIntArray(List list)