Here you can find the source of array2dCopy(Object[][] src, Object[][] dest)
Parameter | Description |
---|---|
src | the source array |
dest | the destination array |
static public void array2dCopy(Object[][] src, Object[][] dest)
//package com.java2s; //License from project: Open Source License public class Main { /**// w ww .ja v a2s.c o m * deep copy a 2D array * * @param src the source array * @param dest the destination array */ static public void array2dCopy(Object[][] src, Object[][] dest) { int n = src.length; for (int i = 0; i < n; i++) { System.arraycopy(src[i], 0, dest[i], 0, n); } } /** * deep copy a 2D array * * @param src the source array * @param dest the destination array */ static public void array2dCopy(float[][] src, float[][] dest) { int n = src.length; for (int i = 0; i < n; i++) { System.arraycopy(src[i], 0, dest[i], 0, n); } } /** * deep copy a 2D array * * @param src the source array * @param dest the destination array */ static public void array2dCopy(int[][] src, int[][] dest) { int n = src.length; for (int i = 0; i < n; i++) { System.arraycopy(src[i], 0, dest[i], 0, n); } } }