Java Object Array Create toObjectArray(int[] oldArray)

Here you can find the source of toObjectArray(int[] oldArray)

Description

to Object Array

License

Open Source License

Declaration

public static Integer[] toObjectArray(int[] oldArray) 

Method Source Code

//package com.java2s;
/**//from   w  w  w. j  a v  a2  s .  c o m
 * Copyright (c) 2014 Xiufeng Liu ( xiufeng.liu@uwaterloo.ca )
 * <p/>
 * This file is free software: you may copy, redistribute and/or modify it
 * under the terms of the GNU General Public License version 2
 * as published by the Free Software Foundation.
 * <p/>
 * This file is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 * <p/>
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see http://www.gnu.org/licenses.
 */

public class Main {
    public static Integer[] toObjectArray(int[] oldArray) {
        Integer[] newArray = new Integer[oldArray.length];
        for (int ctr = 0; ctr < oldArray.length; ctr++) {
            newArray[ctr] = Integer.valueOf(oldArray[ctr]);
        }
        return newArray;
    }
}

Related

  1. toObjectArray(boolean[] primitiveArray)
  2. toObjectArray(byte[] array)
  3. toObjectArray(char... array)
  4. toObjectArray(int[] array)
  5. toObjectArray(int[] array)
  6. toObjectArray(Object array)
  7. toObjectArray(String[][] originalarray)
  8. toObjectArray(T... t)
  9. toObjectArray(T[] v)