Advertisements
Advertisements
प्रश्न
Constructors of base and derived classes are automatically invoked while creating the objects of derived class.
पर्याय
True
False
MCQ
चूक किंवा बरोबर
उत्तर
This statement is True.
Explanation:
- When you create an object of a derived class (also known as a child class) in inheritance, the base class (parent class) constructor is automatically called first, followed by the derived class constructor.
- This occurs because the derived class inherits the properties of the base class, and the base class must be properly initialized before the derived class may access its members.
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?