Array.CreateInstance(GetType(Integer), 11) to create Array : GetType « Development « VB.Net






Array.CreateInstance(GetType(Integer), 11) to create Array

Array.CreateInstance(GetType(Integer), 11) to create Array
Imports System


Public Class MainClass
    
    Shared Sub Main(ByVal args As String())
        Dim squares As Array = _
            Array.CreateInstance(GetType(Integer), 11)

        For i As Integer = 0 To 10
            squares.SetValue(i * i, i)
        Next i

        Dim txt As String = ""
        For i As Integer = 0 To 10
            Console.WriteLine( squares.GetValue(i).ToString )
        Next i

    End Sub

End Class
  

           
       








Related examples in the same category

1.Get data type full name for any objectGet data type full name for any object
2.Use Type.GetType to get type informationUse Type.GetType to get type information
3.Object's GetType MethodObject's GetType Method
4.Get Variable TypeGet Variable Type