java - Add some values before/to character array -


i new arrays in java. if wanted show this:

    0 ....     1 ....     2 ....         3 ....      4 ....   

where:

    ....     ....     ....     ....     ....     2-d char array called char[][] squares. 

how add numbers before squares array?

and, if choose 1 number, say, 3, , wanted add ">" right next 3, how should that? so, want is:

    0 ....     1 ....     2 ....         3>....      4 .... 

try this

private void print_array(char[][] squares, int selectedindex){     for(int =0;i<squares.length;i++){         system.out.print(i);         if(i == selectedindex){             system.out.print(">");         }         for(int j = 0;j<squares[i].length;j++){             system.out.print(squares[i][j]);         }         system.out.println();     } } 

Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -