In C#, A Jagged array is an one type of array of arrays.We can initialize a jagged array as −
int[][] num =newint [2][]{ newint[]{11,12,13}, newint[]{10,20,30,40}};
Where, num is an array of two arrays of integers - num[0] is an array of 3 integers and num[1] is an array of 4 integers.The method Length returns the number of arrays contained in the jagged array. A jagged array is an array of arrays, and therefore its elements are reference types and are initialized to null.The elements of a jagged array can be of different dimensions and sizes. A jagged array is sometimes called an "array of arrays."
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
In C#, A Jagged array is an one type of array of arrays.We can initialize a jagged array as −
Where, num is an array of two arrays of integers - num[0] is an array of 3 integers and num[1] is an array of 4 integers.The method Length returns the number of arrays contained in the jagged array. A jagged array is an array of arrays, and therefore its elements are reference types and are initialized to null. The elements of a jagged array can be of different dimensions and sizes. A jagged array is sometimes called an "array of arrays."