| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| |||
| public class TwoDimensionalArray { public static void main(String[] args) { int[][] a = new int[5][8]; for (int rows=0; rows <a.length; rows++) { for (int column =0; column <a[rows].length; column++) { a[rows][column]= rows; System.out.print( ((rows*8)+column) + " "); } System.out.println(); } } } my code goes like this so far: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24.... and so on to 39.. how do i make it so that it looks like this: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 and then 6 numbers then 7 then 8... |