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:
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