Module Module1
Sub Main()
Dim matrix(,) As Integer = New Integer(,) {{1, 1}, {2, 2}, {3, 3}, {4, 4}}
Dim rows As Integer = matrix.GetUpperBound(0) + 1
Dim cols As Integer = matrix.GetUpperBound(1) + 1
Console.WriteLine("rows = {0}", rows)
Console.WriteLine("cols = {0}", cols)
End Sub
End Module
' run:
'
' rows = 4
' cols = 2