Difficulty: Easy
Correct Answer: Properties can be declared inside an interface.
Explanation:
Introduction / Context:
This item checks fundamental truths about C# interfaces: multiple implementation, interface inheritance, and the kinds of members interfaces can declare.
Given Data / Assumptions:
Concept / Approach:
Eliminate false claims: single-interface-only implementation is false; exclusivity of implementation to a single class is false; prohibition on multiple base interfaces is false; and “interfaces cannot be inherited” is false. The remaining positive fact is that properties are allowed inside interfaces.
Step-by-Step Solution:
Verification / Alternative check:
Write interface IX { int P { get; set; } } and interface IY : IX, IDisposable { }. Implement both in various classes; compilation succeeds.
Why Other Options Are Wrong:
They contradict the multiple-interface implementation/inheritance features of C#.
Common Pitfalls:
Confusing class single inheritance (only one base class) with interface multiple inheritance (many interfaces).
Final Answer:
Properties can be declared inside an interface.
Discussion & Comments