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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vishal YelvePosted Oct 3, 2022, 2:50 PM
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
Vishal JoshiPosted Oct 3, 2022, 8:33 AM
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.
Rajanikant HawaldarPosted Oct 3, 2022, 8:11 AM
It won't inherit but base class constructor will be called when you create object for child class