Java examples for Collection Framework:Array Clone
Returns a deep clone of a 2D boolean array.
//package com.java2s; public class Main { /**//from w w w.j a va 2s.c o m * Returns a deep clone of a 2D boolean array. * * @param src The 2D-array to clone * @return | deepEquals(result, src) * @return | !src.equals(result) * @return | for each int rowNumber in 0..src.lenght-1: * | !src[rowNumber].equals(result[rowNumber]) */ public static boolean[][] deepClone(boolean[][] src) { assert (src != null); boolean[][] dest = new boolean[src.length][]; for (int i = 0; i < src.length; i++) { dest[i] = src[i].clone(); } return dest; } }