In C#,
A child class that inherits the base class
While inheriting automatically the public, protected, internal members of the base class, it also inherits those base class's constructor and finalizers?
In C#,
A child class that inherits the base class
While inheriting automatically the public, protected, internal members of the base class, it also inherits those base class's constructor and finalizers?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Oct 3, 2022, 4:11 AM EDT
It won't inherit but base class constructor will be called when you create object for child class
Vishal JoshiRank #377 · 6.7K reputationPosted Oct 3, 2022, 4:33 AM EDT
In inheritance, the derived class inherits all the members(fields, methods) of the base class, but the derived class cannot inherit the constructor of the base class because constructors are not members of the class. Instead of inheriting constructors by the derived class, it is only allowed to invoke the constructor of a base class.
Vishal YelveRank #178 · 13.6K reputationPosted Oct 3, 2022, 10:50 AM EDT
In C#, the class which inherits the members of another class is called the derived class and the class whose members are inherited is called the base class.
IMP Points