Constructor's in object oriented program are a special category of methods/functions used to initialize all of the local variables of a class for any object. Constructor as the same name as of the class. if no constructor is defined than a constructor already exists which may set all the values of variables to null.
Constructer is a special type of member function having same name as that of it's class and gets called upon creation of an object inorder to construct it and initialize it if required...... It doesn't take any argument .Not even void.............By simply declaring an object the default constructer of the associated class gets called..........Or by passing parameter explicitely during object declaration
No comments:
Post a Comment