मराठी
तामिळनाडू बोर्ड ऑफ सेकेंडरी एज्युकेशनएचएससी विज्ञान इयत्ता ११

Write some facts about the execution of constructors and destructors in inheritance? - Computer Science

Advertisements
Advertisements

प्रश्न

Write some facts about the execution of constructors and destructors in inheritance?

टीपा लिहा

उत्तर

  1. Base class constructors are executed first, before the derived class constructor's execution.
  2. A derived class cannot inherit the base class constructor but it can call the base class constructor by using Base_class name: :base_class_constructor() in the derived class definition
  3. If there are multiple base classes, then it starts executing from the leftmost base class
  4. In multilevel inheritance, the constructors will be executed in the order of inheritance The destructors are executed in the reverse order of inheritance.
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 16: Inheritance - Evaluation - Section - C [पृष्ठ २७३]

APPEARS IN

सामाचीर कलवी Computer Science [English] Class 11 TN Board
पाठ 16 Inheritance
Evaluation - Section - C | Q 5. | पृष्ठ २७३
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×