Constructor In VB.NET

Constructor In VB.NET


Constructor:-A Constructor is a special  kinds of member function that used to initialize the object .
A constructor is like  a method in that it contain executable code and may be defined with parameter.
this is first method that is run when an instance of type is created.
 constructor is two types in VB.NET
  • Instance constructor
  • Shared constructor
Instance constructor:-"An Instance constructor runs whenever the CLR creates an object from a class"  


Module Testcons
    Sub Main()
        Console.WriteLine("100")
        A.G()
        Console.ReadKey()

    End Sub

End Module

Class A
    Shared Sub G()
        Console.WriteLine("Init A")
    End Sub
End Class

Comments

AB InfoTech

reach out : abinfotechnology@gmail.com