Difficulty: Easy
Correct Answer: A class that implements an interface can explicitly implement members of that interface.
Explanation:
Introduction / Context:
This question distinguishes between how interfaces are consumed by classes and how interfaces relate to each other. It also clarifies explicit interface implementation.
Given Data / Assumptions:
Concept / Approach:
Explicit interface implementation lets a class provide an implementation that is only accessible through the interface reference (e.g., void IFoo.M() { … }). While multiple classes can implement the same interface, this question requires a single correct choice; we therefore use the statement that is both precise and uniquely framed.
Step-by-Step Solution:
Verification / Alternative check:
Write class C : IFoo { void IFoo.M() { } } and call ((IFoo)new C()).M(); — compiles and runs.
Why Other Options Are Wrong:
They misuse terms (implement vs inherit), or incorrectly restrict who can implement, or claim bodies exist in interface methods.
Common Pitfalls:
Mixing up interface-to-interface inheritance with implementation by classes; forgetting explicit implementation exists.
Final Answer:
A class that implements an interface can explicitly implement members of that interface.
Discussion & Comments