Lesson 3 Two Dimensional Array
Lesson 3 Two Dimensional Array
Arrays
3 Two-Dimensional Array
LESSON 3
CC 104 Computer Programming 2
Two–dimensional array can be initialized as:
on 0 10 20 30
1 40 50 60
LESSON 3
CC 104 Computer Programming 2
To access the elements of a two –dimensional
array, you need a pair of indices: one for the
row position and one for the column position.
Accessing
Elements
Example 1 :
of a 2D System.out.print(num[0][1]);
LESSON 3
CC 104 Computer Programming 2
Example 2 :
LESSON 3
CC 104 Computer Programming 2
A two-dimensional array can be processed in
three ways: