C Sharp Inheritance Questions and Answers

Take Exam

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

11. What keyword is used to implement inheritance in C#?

  • extends
  • inherits
  • implements
  • colon (:)
Show Answer Report

12. Which class cannot be inherited in C#?

  • Abstract class
  • Sealed class
  • Static class
  • Partial class
Show Answer Report

13. What is the root class of all classes in C#?

  • System
  • Base
  • Object
  • Root
Show Answer Report

14. Which access modifier allows a member to be accessible only within its own class and derived classes?

  • private
  • public
  • internal
  • protected
Show Answer Report

15. What keyword is used to call the base class constructor from a derived class?

  • super
  • this
  • base
  • parent
Show Answer Report

16. Which of the following is true about abstract classes?

  • They can be instantiated
  • They cannot have abstract methods
  • They cannot be inherited
  • They must be inherited to be used
Show Answer Report

17. What is the main purpose of the "virtual" keyword in C#?

  • To make method static
  • To prevent method overriding
  • To allow method overriding
  • To make method private
Show Answer Report

18. Which keyword is used to override a method in a derived class?

  • overrides
  • new
  • override
  • virtual
Show Answer Report

19. What happens if a class does not explicitly inherit from any class?

  • It becomes a sealed class
  • It inherits from Object class
  • It causes compilation error
  • It becomes an abstract class
Show Answer Report

20. Which of the following can implement multiple inheritance in C#?

  • Abstract classes
  • Sealed classes
  • Interfaces
  • Static classes
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test