Initialize two dimensional array by index : Multiple dimensional array « Collections « VB.Net Tutorial






Public Class Tester
    Public Shared Sub Main
    
        Dim SqaresTable(5, 1) As Integer
    
        SqaresTable(0, 0) = 0
        SqaresTable(0, 1) = 0
        SqaresTable(1, 0) = 1
        SqaresTable(1, 1) = 1
        SqaresTable(2, 0) = 2
        SqaresTable(2, 1) = 4
        SqaresTable(3, 0) = 3
        SqaresTable(3, 1) = 9
        SqaresTable(4, 0) = 4
        SqaresTable(4, 1) = 16
        SqaresTable(5, 0) = 5
        SqaresTable(5, 1) = 25
    
        Console.WriteLine(SqaresTable(2, 1))
    
    End Sub

End Class
4








8.7.Multiple dimensional array
8.7.1.Initialize two dimensional array by index
8.7.2.Initializing multi-dimensional arrays
8.7.3.Rectangular Array
8.7.4.Define and initialize the two dimensional array
8.7.5.Jagged two-dimensional array example.
8.7.6.Declare the jagged array as 4 rows high
8.7.7.Reference elements in two dimensional array
8.7.8.Use For Each/Next to find an element in a two dimension array
8.7.9.Set the array of arrays