making a 2D array containing numbers
public static int [ ] [ ] makeArray ( int n ) { int [ ] [ ] arr = new int [ n ] [ n ] ; int c = 1 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) arr [ i ] [ j ] = c ++ ; } return arr ; }