Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    /**
     * Converts to object array.
     */
    public static Byte[] valuesOf(byte[] array) {
        Byte[] dest = new Byte[array.length];
        for (int i = 0; i < array.length; i++) {
            dest[i] = Byte.valueOf(array[i]);
        }
        return dest;
    }

    /**
     * Converts to object array.
     */
    public static Character[] valuesOf(char[] array) {
        Character[] dest = new Character[array.length];
        for (int i = 0; i < array.length; i++) {
            dest[i] = Character.valueOf(array[i]);
        }
        return dest;
    }

    /**
     * Converts to object array.
     */
    public static Short[] valuesOf(short[] array) {
        Short[] dest = new Short[array.length];
        for (int i = 0; i < array.length; i++) {
            dest[i] = Short.valueOf(array[i]);
        }
        return dest;
    }

    /**
     * Converts to object array.
     */
    public static Integer[] valuesOf(int[] array) {
        Integer[] dest = new Integer[array.length];
        for (int i = 0; i < array.length; i++) {
            dest[i] = Integer.valueOf(array[i]);
        }
        return dest;
    }

    /**
     * Converts to object array.
     */
    public static Long[] valuesOf(long[] array) {
        Long[] dest = new Long[array.length];
        for (int i = 0; i < array.length; i++) {
            dest[i] = Long.valueOf(array[i]);
        }
        return dest;
    }

    /**
     * Converts to object array.
     */
    public static Float[] valuesOf(float[] array) {
        Float[] dest = new Float[array.length];
        for (int i = 0; i < array.length; i++) {
            dest[i] = Float.valueOf(array[i]);
        }
        return dest;
    }

    /**
     * Converts to object array.
     */
    public static Double[] valuesOf(double[] array) {
        Double[] dest = new Double[array.length];
        for (int i = 0; i < array.length; i++) {
            dest[i] = Double.valueOf(array[i]);
        }
        return dest;
    }

    /**
     * Converts to object array.
     */
    public static Boolean[] valuesOf(boolean[] array) {
        Boolean[] dest = new Boolean[array.length];
        for (int i = 0; i < array.length; i++) {
            dest[i] = Boolean.valueOf(array[i]);
        }
        return dest;
    }
}