What are the Special Features of Constructors ?

No comments



 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.

No comments :

Post a Comment

Subscribe

Milan Panda
Admin
About Me | Contact
Copyright 2023-2024 © Programming1011 . 🎀 Developed and Design By- Milan Panda. Happy Holi All Of You 🎀