What are the Special Features of Constructors ?
Special Features of Constructors :
· The constructor function have the following special characteristics :
· They should be declared in the public section.
· They are invoked automatically when the objects are created.
· They do not have return types, even void and therefore , they cannot return values.
· They cannot be inherited, through a derived class can call the base class constructor.
· Like other C++ functions, they can have default arguments.
· Constructor cannot be virtual.
· We cannot refer to their address.
· An object with a constructor (or destructor) cannot be used as a member of a union.
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment