Here you can find the source of clone(double[] p)
public static double[] clone(double[] p)
//package com.java2s; //License from project: Open Source License public class Main { public static double[] clone(double[] p) { double[] ret = new double[p.length]; System.arraycopy(p, 0, ret, 0, p.length); return ret; }// www .java 2 s . co m public static float[] clone(float[] p) { float[] ret = new float[p.length]; System.arraycopy(p, 0, ret, 0, p.length); return ret; } public static int[] clone(int[] p) { int[] ret = new int[p.length]; System.arraycopy(p, 0, ret, 0, p.length); return ret; } public static byte[] clone(byte[] p) { byte[] ret = new byte[p.length]; System.arraycopy(p, 0, ret, 0, p.length); return ret; } public static char[] clone(char[] p) { char[] ret = new char[p.length]; System.arraycopy(p, 0, ret, 0, p.length); return ret; } public static long[] clone(long[] p) { long[] ret = new long[p.length]; System.arraycopy(p, 0, ret, 0, p.length); return ret; } public static short[] clone(short[] p) { short[] ret = new short[p.length]; System.arraycopy(p, 0, ret, 0, p.length); return ret; } public static String[] clone(String[] p) { String[] ret = new String[p.length]; System.arraycopy(p, 0, ret, 0, p.length); return ret; } public static boolean[] clone(boolean[] p) { boolean[] ret = new boolean[p.length]; System.arraycopy(p, 0, ret, 0, p.length); return ret; } public static double[][] clone(double[][] p) { double[][] ret = new double[p.length][p[0].length]; int nr = p.length; for (int i = 0; i < nr; i++) { System.arraycopy(p[i], 0, ret[i], 0, p[0].length); } return ret; } public static float[][] clone(float[][] p) { float[][] ret = new float[p.length][p[0].length]; int nr = p.length; for (int i = 0; i < nr; i++) { System.arraycopy(p[i], 0, ret[i], 0, p[0].length); } return ret; } public static int[][] clone(int[][] p) { int[][] ret = new int[p.length][p[0].length]; int nr = p.length; for (int i = 0; i < nr; i++) { System.arraycopy(p[i], 0, ret[i], 0, p[0].length); } return ret; } public static long[][] clone(long[][] p) { long[][] ret = new long[p.length][p[0].length]; int nr = p.length; for (int i = 0; i < nr; i++) { System.arraycopy(p[i], 0, ret[i], 0, p[0].length); } return ret; } public static short[][] clone(short[][] p) { short[][] ret = new short[p.length][p[0].length]; int nr = p.length; for (int i = 0; i < nr; i++) { System.arraycopy(p[i], 0, ret[i], 0, p[0].length); } return ret; } public static byte[][] clone(byte[][] p) { byte[][] ret = new byte[p.length][p[0].length]; int nr = p.length; for (int i = 0; i < nr; i++) { System.arraycopy(p[i], 0, ret[i], 0, p[0].length); } return ret; } public static boolean[][] clone(boolean[][] p) { boolean[][] ret = new boolean[p.length][p[0].length]; int nr = p.length; for (int i = 0; i < nr; i++) { System.arraycopy(p[i], 0, ret[i], 0, p[0].length); } return ret; } public static String[][] clone(String[][] p) { String[][] ret = new String[p.length][p[0].length]; int nr = p.length; for (int i = 0; i < nr; i++) { System.arraycopy(p[i], 0, ret[i], 0, p[0].length); } return ret; } }