Java Object Array Create toObjectArray(int[] array)

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

Description

to Object Array

License

Open Source License

Declaration

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

Method Source Code

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

public class Main {
    public static Integer[] toObjectArray(int[] array) {
        Integer[] result = new Integer[array.length];
        for (int i = 0; i < array.length; i++)
            result[i] = array[i];//from ww w . j  a  v  a  2  s  .c  o  m
        return result;
    }

    public static Double[] toObjectArray(double[] array) {
        Double[] result = new Double[array.length];
        for (int i = 0; i < array.length; i++)
            result[i] = array[i];
        return result;
    }

    public static Float[] toObjectArray(float[] array) {
        Float[] result = new Float[array.length];
        for (int i = 0; i < array.length; i++)
            result[i] = array[i];
        return result;
    }

    public static Byte[] toObjectArray(byte[] array) {
        Byte[] result = new Byte[array.length];
        for (int i = 0; i < array.length; i++)
            result[i] = array[i];
        return result;
    }

    public static Short[] toObjectArray(short[] array) {
        Short[] result = new Short[array.length];
        for (int i = 0; i < array.length; i++)
            result[i] = array[i];
        return result;
    }

    public static Long[] toObjectArray(long[] array) {
        Long[] result = new Long[array.length];
        for (int i = 0; i < array.length; i++)
            result[i] = array[i];
        return result;
    }

    public static Boolean[] toObjectArray(boolean[] array) {
        Boolean[] result = new Boolean[array.length];
        for (int i = 0; i < array.length; i++)
            result[i] = array[i];
        return result;
    }

    public static Character[] toObjectArray(char[] array) {
        Character[] result = new Character[array.length];
        for (int i = 0; i < array.length; i++)
            result[i] = array[i];
        return result;
    }
}

Related

  1. toObjectArray(boolean arr[])
  2. toObjectArray(boolean[] primitiveArray)
  3. toObjectArray(byte[] array)
  4. toObjectArray(char... array)
  5. toObjectArray(int[] array)
  6. toObjectArray(int[] oldArray)
  7. toObjectArray(Object array)
  8. toObjectArray(String[][] originalarray)