मराठी

Constructors of base and derived classes are automatically invoked while creating the objects of derived class. - Computer Applications

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:

  1. 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.
  2. 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
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 8: Encapsulation and Inheritance - EXERCISES [पृष्ठ ४४५]

APPEARS IN

अविचल Computer Applications [English] Class 10 ICSE
पाठ 8 Encapsulation and Inheritance
EXERCISES | Q III. 7. | पृष्ठ ४४५
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×