Jagged array Example
Console application
Source code:-
Module Module1
Sub Main()
Dim arr()() As Integer = New Integer(2)() {}
Dim a(2) As Integer
a(0) = 10
a(1) = 100
a(2) = 1000
arr(0) = a
Dim a1(0) As Integer
arr(1) = a1
Dim a2() As Integer = New Integer() {1, 2, 3, 4}
arr(2) = a2
For i As Integer = 0 To arr.Length - 1
Dim j As Integer() = arr(i)
For n As Integer = 0 To j.Length - 1
Console.Write(j(n))
Console.Write(" "c)
Next
Console.WriteLine()
Next
Console.ReadLine()
End Sub
End Module
Output:-
0 comments:
Post a Comment