Program Structure

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
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.152.183