Java Collection to Array toIntArray(final Collection collection)

Here you can find the source of toIntArray(final Collection collection)

Description

to Int Array

License

Open Source License

Declaration

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

Method Source Code


//package com.java2s;
import java.util.*;

public class Main {
    public static int[] toIntArray(final Collection<Integer> collection) {
        final int[] array = new int[collection.size()];
        int i = 0;
        for (Integer integer : collection)
            array[i++] = integer;/*from   w w w.  ja va2 s .  c o  m*/
        return array;
    }
}

Related

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