1. The Constructor is the first method that is run when an instance of a type is created. In visual basic a constructor is always Sub new ().
2. Constructor are use to initialize class and structure data before use. Constructor never returns a value and can be overridden to provide custom initialization functionality.
3. The constructor provides a way to set default values for data or perform other necessary functions before the object available for use.
Destructors are called just before an object is destroyed and can be used to run clean-up code. You can’t control when a destructor is called.
Asked In: Many Interviews |