Creating 2D Arrays in Java Either one of the following two coding techniques will create an array that will hold 150 integers -- 10 rows of 15 integers each.
Either one of the following two coding techniques will create an array that will hold 200 Cells. A Cell would be some type of user defined class
you can have an array of any data type, including an array of a class you create! Assign Values in a 2-DArray The following code will place 150 random integers from 0 to 99 into the array n
in this case the row and col is used as the indices of the array and the counter for the for loop's The following code will create 200 cells into the array universe
in this case the row and col is used as:
|
05.0 Java Notes >