public static final char[][] deepCopy(char[][] toCopy){
  int toCopyLength=toCopy.length;
  char[][] result=new char[toCopyLength][];
  for (int i=0; i < toCopyLength; i++) {
    char[] toElement=toCopy[i];
    int toElementLength=toElement.length;
    char[] resultElement=new char[toElementLength];
    System.arraycopy(toElement,0,resultElement,0,toElementLength);
    result[i]=resultElement;
  }
  return result;
}

public static final char [ ] [ ] deepCopy ( char [ ] [ ] toCopy ) { int toCopyLength = toCopy . length ; char [ ] [ ] result = new char [ toCopyLength ] [ ] ; for ( int i = 0 ; i < toCopyLength ; i ++ ) { char [ ] toElement = toCopy [ i ] ; int toElementLength = toElement . length ; char [ ] resultElement = new char [ toElementLength ] ; System . arraycopy ( toElement , 0 , resultElement , 0 , toElementLength ) ; result [ i ] = resultElement ; } return result ; }
answers a deep copy of the tocopy array .
