C# Inheritance Interview Questions and Answers - 2
Question: 6
What are characteristics of Inheritance?
Abstract classes cannot be inherited.
Sealed classes cannot be inherited.
A derived class extends its direct base class. It can add new members to the derived class.
Constructors and destructors are not inherited.
A derived class can hide an inherited member.
A derived class can override an inherited member.
Question: 7
What are the characteristics of abstract class?
It cannot be instantiated directly.
It can have abstract members.
We cannot apply a sealed modifier.
Question: 8
What is the use of base keyword?
A subclass constructor is used to construct the instance variables of both the derived class and the base class.
The subclass constructor uses the keyword base to invoke the constructor method of the super class.
Question: 9
When you inherit a protected class-level variable, who is it available to?
Classes in the same namespace.
Question: 10
Give the restrictions of new modifier?
A member declaration with a new modifier hides an inherited member only with in the scope of the new member.
A member declaration with a new modifier cannot include override keyword in its declaration.
It is an error to include both new and override modifier in the same declaration.
GATE Chemical Engineering Questions and Answers More
GATE 2024-2025 Question Paper Pdf Download More
Banking Awareness Questions 2024-2025 More
Computer Quiz Questions for Bank Exams More
Computer Quiz Questions for Bank Exams More
100+ Pipes and Cisterns Questions for Bank Exams More
Tamil Nadu Municipal Administration Water Supply Question Paper Pdf More
History General Awareness Gk Questions and Answers More
1000+ Aptitude Test Sample Questions and Answers More
Computer Awareness Questions & Answers for Competitive Exams More