Java Array Clone clone2DArray(Double[][] array)

Here you can find the source of clone2DArray(Double[][] array)

Description

Clones a 2D Double Array

License

Open Source License

Parameter

Parameter Description
array : 2D Double Array

Return

: exact copy of the Array

Declaration

public static Double[][] clone2DArray(Double[][] array) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*from w w  w.  j  ava 2  s. c o  m*/
     * Clones a 2D Double Array
     * 
     * @param array : 2D Double Array 
     * @return : exact copy of the Array
     */
    public static Double[][] clone2DArray(Double[][] array) {
        Double[][] new_array = new Double[array.length][array[0].length];
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array.length; j++) {
                new_array[i][j] = new Double(array[i][j]);
            }
        }

        return new_array;
    }
}

Related

  1. clone(String[] array)
  2. clone(T[] array)
  3. clone(T[] array)
  4. clone(T[] array)
  5. clone2DArray(double[][] a)
  6. clone2dArray(double[][] myArray)
  7. clone2DArray(final boolean[][] array)
  8. clone_multidim_array(float[][] arr)
  9. cloneAndMultiplyArray(float[] array, float factor)