Java Collection to Array toIntArray(Collection list)

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

Description

to Int Array

License

Open Source License

Declaration

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

Method Source Code

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

import java.util.Collection;

public class Main {
    public static int[] toIntArray(Collection<Integer> list) {
        int n = list == null ? 0 : list.size();
        int[] arr = new int[n];
        if (list != null) {
            int i = 0;
            for (int d : list)
                arr[i++] = d;//from  www.jav  a2 s  .c om
        }
        return arr;
    }
}

Related

  1. toIntArray(Collection collection)
  2. toIntArray(Collection collection)
  3. toIntArray(Collection collection)
  4. toIntArray(Collection ints)
  5. toIntArray(Collection list)
  6. toIntArray(Collection values)
  7. toIntArray(final Collection c)
  8. toIntArray(final Collection col)
  9. toIntArray(final Collection collection)