Bird
Raised Fist0

Which keyword is used in C# to call the base class constructor from a derived class?

easy🧠 Conceptual Q2 of Q15
C Sharp (C#) - Inheritance
Which keyword is used in C# to call the base class constructor from a derived class?
Aparent
Bsuper
Cbase
Dthis
Step-by-Step Solution
Solution:
  1. Step 1: Identify constructor call syntax in inheritance

    In C#, the keyword to call the base class constructor from a derived class is base.
  2. Step 2: Differentiate from other keywords

    super is used in some other languages like Java, this refers to the current class, and parent is not a C# keyword.
  3. Final Answer:

    base -> Option C
  4. Quick Check:

    Base constructor call keyword = base [OK]
Quick Trick: Use 'base' to call base class constructor in derived class [OK]
Common Mistakes:
MISTAKES
  • Using 'super' instead of 'base'
  • Confusing 'this' with base constructor call
  • Assuming 'parent' is a valid keyword

Want More Practice?

15+ quiz questions · All difficulty levels · Free

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