Flowchart
Examples of 2-D Declarations
Flowchart content
2-D ARRAYS
String[][] a = new String[3][4];
a[0][0]
a[0][1]
a[0][2]
a[0][3]
a[1][0]
a[1][1]
a[1][2]
a[1][3]
a[2][0]
a[2][1]
a[2][2]
a[2][3]
Each block represents a String variable
Each row represents an array of 4 elements
int[][] nums = {{1, 2, 3, 4}, {2, 11, 16, 3}, {18, 45, 31, 2}, {3, 51, 43, 1}};
This array has 4 rows and 4 columns, and it is made up of integer variables
1
2
3
4
2
11
16
3
18
45
31
2
3
51
43
1
int temp = nums[2][0];
The above declaration will assign the value 18 to the variable temp. 18 is located in the 3rd row (index 2) and first column (index 0) of the matrix
Information
- Description
- Flowchart on Examples of 2-D Declarations, created by Olivia B on 01/06/2018.
- Created by
- Olivia B
- Views
- 2
- Rating