Bird
0
0

In C#, which keyword is used to establish inheritance between two classes, representing an Is-a relationship?

easy🧠 Conceptual Q2 of 15
C Sharp (C#) - Inheritance
In C#, which keyword is used to establish inheritance between two classes, representing an Is-a relationship?
Aextends
B:
Cinherits
Dimplements
Step-by-Step Solution
Solution:
  1. Step 1: Recall C# inheritance syntax

    In C#, inheritance is expressed using a colon ':' after the derived class name.
  2. Step 2: Evaluate options

    extends ('extends') is Java syntax. inherits ('inherits') is not a C# keyword. implements ('implements') is used for interfaces, not classes.
  3. Final Answer:

    C -> Option B
  4. Quick Check:

    Use ':' to inherit in C# [OK]
Quick Trick: Use ':' to declare inheritance in C# [OK]
Common Mistakes:
MISTAKES
  • Using 'extends' instead of ':'
  • Confusing 'implements' with inheritance
  • Assuming 'inherits' is a keyword

Want More Practice?

15+ quiz questions · All difficulty levels · Free

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