Bird
0
0

Which keyword is used in C# to chain constructors within the same class?

easy🧠 Conceptual Q2 of 15
C Sharp (C#) - Inheritance
Which keyword is used in C# to chain constructors within the same class?
Abase
Bsuper
Cthis
Dnew
Step-by-Step Solution
Solution:
  1. Step 1: Recall constructor chaining syntax

    In C#, the keyword 'this' is used to call another constructor in the same class.
  2. Step 2: Differentiate from other keywords

    'base' calls a constructor in the base class, 'super' is not used in C#, and 'new' creates new objects.
  3. Final Answer:

    this -> Option C
  4. Quick Check:

    Constructor chaining keyword = this [OK]
Quick Trick: Use 'this' to chain constructors in the same class [OK]
Common Mistakes:
MISTAKES
  • Using 'base' instead of 'this' for same-class chaining
  • Confusing 'super' from other languages
  • Trying to use 'new' for chaining

Want More Practice?

15+ quiz questions · All difficulty levels · Free

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