Here you can find the source of clone(double[] array)
Parameter | Description |
---|---|
array | Array to append to clone |
public static double[] clone(double[] array)
//package com.java2s; /**//w ww. j a v a2 s .c o m * ArrayUtils.java * * Subject to the apache license v. 2.0 * * http://www.apache.org/licenses/LICENSE-2.0.txt * * @author william@rattat.com */ public class Main { /** * Return a new copy of a double aray holding the same elements * * @param array Array to append to clone * * @return The cloned array */ public static double[] clone(double[] array) { if (array == null) { return null; } double[] clone = new double[array.length]; for (int i = 0; i < array.length; i++) { clone[0] = array[i]; } return clone; } /** * Return a new copy of an int aray holding the same elements * * @param array Array to append to clone * * @return The cloned array */ public static int[] clone(int[] array) { if (array == null) { return null; } int[] clone = new int[array.length]; for (int i = 0; i < array.length; i++) { clone[0] = array[i]; } return clone; } /** * Return a new copy of an object aray holding the same elements * * @param array Array to append to clone * * @return The cloned array */ public static Object[] clone(Object[] array) { if (array == null) { return null; } Object[] clone = new Object[array.length]; for (int i = 0; i < array.length; i++) { clone[0] = array[i]; } return clone; } }