Java Array Clone clone(T[] array)

Here you can find the source of clone(T[] array)

Description

clone

License

Open Source License

Declaration

public static <T> T[] clone(T[] array) 

Method Source Code

//package com.java2s;

public class Main {

    public static <T> T[] clone(T[] array) {
        if (array == null) {
            return null;
        }/*  w ww  .j  a  v a  2s .  co m*/

        return array.clone();
    }

    public static long[] clone(long[] array) {
        if (array == null) {
            return null;
        }

        return array.clone();
    }

    public static int[] clone(int[] array) {
        if (array == null) {
            return null;
        }

        return array.clone();
    }

    public static short[] clone(short[] array) {
        if (array == null) {
            return null;
        }

        return array.clone();
    }

    public static byte[] clone(byte[] array) {
        if (array == null) {
            return null;
        }

        return array.clone();
    }

    public static double[] clone(double[] array) {
        if (array == null) {
            return null;
        }

        return array.clone();
    }

    public static float[] clone(float[] array) {
        if (array == null) {
            return null;
        }

        return array.clone();
    }

    public static boolean[] clone(boolean[] array) {
        if (array == null) {
            return null;
        }

        return array.clone();
    }

    public static char[] clone(char[] array) {
        if (array == null) {
            return null;
        }

        return array.clone();
    }
}

Related

  1. clone(Object[] array)
  2. clone(Object[] source)
  3. clone(Object[] src, Object[] trg)
  4. clone(String[] array)
  5. clone(T[] array)
  6. clone(T[] array)
  7. clone2DArray(double[][] a)
  8. clone2DArray(Double[][] array)
  9. clone2dArray(double[][] myArray)