What is Constructors and distructors?

Submitted by: Administrator
when we initialize the form at that time if we want to set any variable's value then we can set it by defining in constructor. constructor 's name always same as class name.and destructor is used to recover memory occupied by any variable defining in constructor.

constructor and destructor is the new way in object oriented languages to initialize the varibles at the time of object creation.
when we declare an object,we can pass the values to it,and that values will be assigned to the data members of that class,whose object it is.
a class can have no. of objects and no. of constructors. an constructor is called automatically when an object is created.
there is only one destructor in any class,that is to deallocated the memory of the object when an object is destroyed or no longer exist
Submitted by: Administrator

Read Online VBA (Visual Basic for Applications) Job Interview Questions And Answers