I just got bit by using .clone()
on my 2d boolean
array, thinking that this was a deep copy.
How can I perform a deep copy of my bool
I'm a fan of the Arrays utility. It has a copyOf method that will do a deep copy of a 1-D array for you, so you'd want something like this:
//say you have boolean[][] foo;
boolean[][] nv = new boolean[foo.length][foo[0].length];
for (int i = 0; i < nv.length; i++)
nv[i] = Arrays.copyOf(foo[i], foo[i].length);