Java Array Clone clone(boolean[] in)

Here you can find the source of clone(boolean[] in)

Description

clone

License

Apache License

Declaration

public static boolean[] clone(boolean[] in) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static boolean[] clone(boolean[] in) {
        boolean[] ret = new boolean[in.length];
        System.arraycopy(in, 0, ret, 0, in.length);
        return ret;
    }//from ww  w . j  a  v  a  2s  . c  o  m

    public static int[] clone(int[] in) {
        int[] ret = new int[in.length];
        System.arraycopy(in, 0, ret, 0, in.length);
        return ret;
    }

    public static double[] clone(double[] in) {
        double[] ret = new double[in.length];
        System.arraycopy(in, 0, ret, 0, in.length);
        return ret;
    }

    public static float[] clone(float[] in) {
        float[] ret = new float[in.length];
        System.arraycopy(in, 0, ret, 0, in.length);
        return ret;
    }

    public static short[] clone(short[] in) {
        short[] ret = new short[in.length];
        System.arraycopy(in, 0, ret, 0, in.length);
        return ret;
    }

    public static char[] clone(char[] in) {
        char[] ret = new char[in.length];
        System.arraycopy(in, 0, ret, 0, in.length);
        return ret;
    }

    public static long[] clone(long[] in) {
        long[] ret = new long[in.length];
        System.arraycopy(in, 0, ret, 0, in.length);
        return ret;
    }

    public static byte[] clone(byte[] in) {
        byte[] ret = new byte[in.length];
        System.arraycopy(in, 0, ret, 0, in.length);
        return ret;
    }

    public static Object[] clone(Object[] in) {
        Object[] ret = new Object[in.length];
        System.arraycopy(in, 0, ret, 0, in.length);
        return ret;
    }
}

Related

  1. clone(boolean[] array)
  2. clone(boolean[] array)
  3. clone(byte[] input)
  4. clone(byte[] orig)
  5. clone(byte[][] im)
  6. clone(double[] array)