C Sharp Inheritance Questions and Answers
C# Inheritance questions with answers are key for understanding object-oriented programming concepts in C#. Inheritance allows one class to acquire properties and methods of another, promoting code reusability and modular design. These programming questions and answers with explanations are often featured in technical interview Q&A for companies like Microsoft, Cognizant, and TCS. Practicing C# MCQs on inheritance helps learners grasp concepts like base and derived classes, access modifiers, method overriding, and polymorphism. Regular practice using C# programming interview questions with answers ensures strong command over object-oriented design principles for both academic and professional success.
C Sharp Inheritance
Showing 10 of
29 questions
21. What is the purpose of the "new" keyword when used with inheritance?
- To override a base method
- To hide a base method
- To create a new instance
- To call base class method
22. Which type of class can have abstract methods?
- Sealed class
- Static class
- Abstract class
- Any class
23. What is polymorphism in the context of inheritance?
- Multiple methods with same name
- Ability to take many forms
- Hiding implementation details
- Creating multiple classes
24. Which method is called when an object is created in C#?
- Main()
- Constructor
- Destructor
- Initialize()
25. What is the default access modifier for class members in C#?
- public
- private
- internal
- protected
26. Which inheritance type allows a class to inherit from multiple interfaces?
- Single inheritance
- Multiple inheritance
- Multilevel inheritance
- Hierarchical inheritance
27. What is the purpose of the "this" keyword in inheritance?
- Call base class constructor
- Refer to current instance
- Create new object
- Call static methods
28. Which concept allows a derived class to have multiple base classes through different paths?
- Polymorphism
- Encapsulation
- Diamond problem
- Abstraction
29. What is method overriding in inheritance?
- Creating new method with same name
- Hiding base class method
- Providing specific implementation in derived class
- Making method private