Difficulty: Medium
Correct Answer: None of the above.
Explanation:
Introduction / Context:
This question tests nuanced understanding of interface usage across classes and structs, the correct meaning of the colon syntax, and restrictions on static members with interface implementations.
Given Data / Assumptions:
Concept / Approach:
1) True on its face: classes can implement multiple interfaces. 2) True: structs cannot inherit classes, but they can implement interfaces. 3) False as written: the colon (:) is used after the type name to list base types and interfaces that the type implements or inherits; it does not apply to a “class member.” 4) False: interfaces do not implement classes; classes implement interfaces; interfaces can inherit other interfaces. 5) False in classic C#: methods implementing interface members are instance members; marking them static does not implement the interface member for instances.
Step-by-Step Solution:
Verification / Alternative check:
Declare class C : IComparable, IDisposable { ... } and struct S : IComparable { ... }. Observe that implementations are instance methods, not static.
Why Other Options Are Wrong:
Common Pitfalls:
Misreading (:) as applying to members, and assuming static methods can satisfy instance interface contracts.
Final Answer:
None of the above.
Discussion & Comments