jagged array

jagged array also   store  the data in the form of row  and column like, two dimensional array, but two dimensional array. all the row will be  having equal number of column where as jagged  array the column size different form row  to row.

Jagged array also known as array  of array   because  here  different single dimensional  array  between different signs combined together to form a new array.

Syntax

<type>[ ] [ ]<name>= new <type>[ rows] [];

Int [ ] [ ] arr = new int [3][ ];

Int[ ] [ ] arr = { list of values ];

NOTE

While  declaring  a jagged  array in  that initial declaration we can only specified no of row the new no of row to the array and then are need to specified the column to each row individual.

 

You May Also Like

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll Up