Here you can find the source of toIntegerArray(final int[] ints)
int[]
.
Parameter | Description |
---|---|
ints | the array to be converted |
public static Integer[] toIntegerArray(final int[] ints)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w w w . j ava2 s . c o m * Produces an array of {@link Integer} objects from an <code>int[]</code>. * <p> * Can be used to produce an array of objects to feed an iterator * * @param ints the array to be converted * @return an array of {@link Integer} objects */ public static Integer[] toIntegerArray(final int[] ints) { final Integer[] result = new Integer[ints.length]; for (int i = 0; i < ints.length; i++) { result[i] = Integer.valueOf(ints[i]); } return result; } }