When a class or structure is instantiated, its class constructor (which in VB is a subroutine named New) is automatically invoked. In addition, each executable requires an entry point in the form of a function or subroutine named Main. For example:
Public Class PgmStruct
Private Value As Integer
Public Sub New(x As Integer)
Value = x
End Sub
Public Shared Sub Main( )
Dim obj As New PgmStruct(100)
Console.WriteLine(obj.Value)
End Sub
End Class