Java Array Clone clone(int[] array)

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

Description

Return a clone of the given int array.

License

Open Source License

Parameter

Parameter Description
array the array to clone

Return

the clone of the given array

Declaration

public static int[] clone(int[] array) 

Method Source Code

//package com.java2s;

public class Main {
    /**/* ww  w  . jav a  2s.  co  m*/
     * Return a clone of the given int array. No null checks are performed.
     *
     * @param array the array to clone
     * @return the clone of the given array
     */
    public static int[] clone(int[] array) {
        int[] result = new int[array.length];
        System.arraycopy(array, 0, result, 0, array.length);
        return result;
    }
}

Related

  1. clone(float[] f)
  2. clone(float[][] array)
  3. clone(int[] a)
  4. clone(int[] array)
  5. clone(int[] array)
  6. clone(int[] in)
  7. clone(int[] src)
  8. clone(int[] src, int[] dest)
  9. clone(Object[] array)