Imports System
Public Class Program
Public Shared Sub Print(ByVal arr2D As Integer(,))
Dim rows As Integer = arr2D.GetLength(0)
Dim cols As Integer = arr2D.GetLength(1)
For i As Integer = 0 To rows - 1
For j As Integer = 0 To cols - 1
Console.Write("{0, 4}", arr2D(i, j))
Next
Console.WriteLine()
Next
End Sub
Public Shared Sub Main(ByVal args As String())
Dim grid As Integer(,) = {
{1, 2, 3, 4},
{5, 6, 7, 8},
{9, 10, 11, 12}}
Console.WriteLine("Original Array")
Print(grid)
Dim arr2D As Integer(,)
arr2D = CType(grid.Clone(), Integer(,))
Console.WriteLine("Cloned Array")
Print(arr2D)
End Sub
End Class
' run:
'
' Original Array
' 1 2 3 4
' 5 6 7 8
' 9 10 11 12
' Cloned Array
' 1 2 3 4
' 5 6 7 8
' 9 10 11 12
'