C# Jagged ArraysIn C#, jagged array is also known as "array of arrays" because its elements are arrays. The element size of jagged array can be different. Declaration of Jagged arrayLet's see an example to declare jagged array that has two elements. Initialization of Jagged arrayLet's see an example to initialize jagged array. The size of elements can be different. Initialization and filling elements in Jagged arrayLet's see an example to initialize and fill elements in jagged array. Here, size of elements in jagged array is optional. So, you can write above code as given below: C# Jagged Array ExampleLet's see a simple example of jagged array in C# which declares, initializes and traverse jagged arrays. Output: 11 21 56 78 42 61 37 41 59 63 Initialization of Jagged array upon DeclarationLet's see an example to initialize the jagged array while declaration. C# Jagged Array Example 2Let's see a simple example of jagged array which initializes the jagged arrays upon declaration. Output: 11 21 56 78 2 5 6 7 98 5 2 5 Next TopicC# Params |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India