int [][] myInt; for(int i = 0; i< matrix.length; i++){ for (int j = 0; j < matrix[i].length; ... There are two good ways to copy array is to use clone and System.arraycopy() .
stackoverflow.com