Mega Code Archive

 
Categories / VB.Net / Data Structure
 

Initializing multidimensional arrays

Imports System Public Class MainClass     Shared Sub Main(ByVal args As String())       Dim i, j As Integer       '        Dim array1 As Integer(,)       array1 = New Integer(,) {{1, 2, 3}, {4, 5, 6}}       Console.WriteLine( "Values in array1 by row are " )       For i = 0 To array1.GetUpperBound(0)          For j = 0 To array1.GetUpperBound(1)             Console.WriteLine( array1(i, j) )           Next       Next     End Sub End Class