Array.CreateInstance
Option Strict On
Public Module Arrays
Public Sub Main
Dim arr As Array
Dim int() As Integer = {12, 16, 20, 24, 28, 32}
arr = CType(int, Array)
Dim byFours() As Integer = {12, 24, 36, 48}
Dim names() As String = {"K", "S", "S", "D", "N"}
Dim miscData() As Object = {"this", 12d, 16ui, "a"c}
Dim objArray() As Object
miscData = names
Dim myArray1a() As Integer ' Uninitialized array
Dim myArray1b As Integer() ' Uninitialized array
Dim myArray2(10) As Integer ' 1-dimensional array with 11 elements
Dim Employees1( , ) As Object ' Uninitialized 2-D array
Dim Employees(200, 2) As Object ' 2-D array with 201 and 3 elements
Dim jagged1(9)() As String
Dim jagged2()() As String = New String(9)() {}
Dim myArray1arr As Array
Dim myArray2a As Array = Array.CreateInstance(GetType(Integer), 10)
Dim members() As Integer = {3, 10}
Dim myArray3a As Array = Array.CreateInstance(GetType(Integer), members)
End Sub
End Module
Related examples in the same category