Define constructors and destructors. Constructors
- They are used in a class and are member functions which are used to initialize or set the objects of a class in VB.net. They dont return any value and are defined in a Sub with a keyword New. - Multiple constructors can be created in class with any access specifiers, by default constructors are of Public access type.
Destructors
- They are also called as finalizer and it is a method used to deallocate the resources of an object that are no longer used and they are invoked automatically by the VB.net environment. The keyword Overrides is used with the Finalizer method.
|