Difficulty: Easy
Correct Answer: Interfaces can be inherited (one interface can inherit from another).
Explanation:
Introduction / Context:This question evaluates your grasp of what interfaces are and how they relate to other types in C#.NET. It distinguishes interface inheritance from class inheritance and clarifies what members interfaces may declare.
Given Data / Assumptions:
Concept / Approach:An interface can inherit from one or more interfaces, enabling contract composition. Interfaces themselves do not derive from System.Object in the class-inheritance sense (their BaseType in reflection is null). Historically, interfaces contained signatures for methods, properties, indexers, and events. (Modern C# allows additional patterns, but exams typically focus on classic rules.)
Step-by-Step Solution:
Option B — Correct: interface IChild : IParent { … } is valid. Option A — Incorrect: interfaces are not class types and do not “derive” from Object as classes do. Option C — Incorrect: there is no “Object interface.” Option D — Incorrect: interfaces can also declare properties, indexers, and events (signatures). Option E — Incorrect in typical exam scope: traditional interfaces do not contain static data/methods.Verification / Alternative check:Compile interface I1 { int P { get; } } and interface I2 : I1 { void M(); }. It compiles, proving interface inheritance.
Why Other Options Are Wrong:They either confuse interface inheritance with class inheritance or incorrectly restrict/expand allowed members.
Common Pitfalls:Thinking that all types “inherit” from Object exactly the same way; applying class-only rules to interfaces.
Final Answer:Interfaces can be inherited (one interface can inherit from another).
Discussion & Comments