Here you can find the source of copy5DArray(char[][][][][] original)
public static char[][][][][] copy5DArray(char[][][][][] original)
//package com.java2s; //License from project: Open Source License import java.util.Arrays; public class Main { public static char[][][][][] copy5DArray(char[][][][][] original) { char[][][][][] result = new char[original.length][][][][]; for (int i = 0; i < original.length; i++) { result[i] = new char[original[i].length][][][]; for (int j = 0; j < original[i].length; j++) { result[i][j] = new char[original[i][j].length][][]; for (int k = 0; k < original[i][j].length; k++) { result[i][j][k] = copy2DArray(original[i][j][k]); }/* w ww.ja v a 2 s. co m*/ } } return result; } 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); } 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; } }