Here you can find the source of copy2DArray(char[][] original)
public static char[][] copy2DArray(char[][] original)
//package com.java2s; //License from project: Open Source License import java.util.Arrays; public class Main { public static char[][] copy2DArray(char[][] original) { char[][] result = new char[original.length][]; for (int i = 0; i < original.length; i++) { result[i] = Arrays.copyOf(original[i], original[i].length); }/* w w w. j av a2 s . co m*/ return result; } public static int[][] copy2DArray(int[][] original) { int[][] result = new int[original.length][]; for (int i = 0; i < original.length; i++) { result[i] = Arrays.copyOf(original[i], original[i].length); } return result; } }