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.Iterator;
import java.util.List;

public class Main {
    public static int[] toIntArray(List<Integer> list) {
        int[] array = new int[list.size()];
        Iterator<Integer> ints = list.iterator();
        int idx = 0;
        while (ints.hasNext()) {
            Integer value = ints.next();
            array[idx++] = value.intValue();
        }//from ww w . j av a  2s . com
        return array;
    }
}

Related

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