We use single dimensional array to store a collection of data of same type. But two-dimensional arrays are used to store tabular data. This means when the data is in the form of rows as well as columns we need a more power array to store it. Here is where two dimensional arrays are used, to data the data in the form of table. In two dimensional array declaration we specify number of rows and number of columns.
Consider the following example:
In the above table there are three columns and three rows. So the declaration can be done in the following way:
array above can be declared as:
NOTE: All the rows and columns of this array are of the type Integer