Bird
Raised Fist0

What is the main purpose of a base class in C#?

easy🧠 Conceptual Q11 of Q15
C Sharp (C#) - Inheritance
What is the main purpose of a base class in C#?
ATo hold common code that other classes can reuse
BTo create objects directly without inheritance
CTo prevent other classes from inheriting
DTo store data only without any methods
Step-by-Step Solution
Solution:
  1. Step 1: Understand the role of base class

    A base class contains common code that multiple classes can share to avoid repetition.
  2. Step 2: Compare options with this role

    To hold common code that other classes can reuse matches this purpose exactly, while others describe incorrect or unrelated uses.
  3. Final Answer:

    To hold common code that other classes can reuse -> Option A
  4. Quick Check:

    Base class = shared code [OK]
Quick Trick: Base class shares code for reuse [OK]
Common Mistakes:
MISTAKES
  • Thinking base class cannot be instantiated
  • Confusing base class with interface
  • Believing base class only stores data

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Sharp (C#) Quizzes