Difficulty: Easy
Correct Answer: If a class implements an interface partially, then it should be an abstract class.
Explanation:
Introduction / Context:
Understanding how classes fulfill interface contracts is fundamental to C# design. This question targets partial implementations and what is permitted inside interfaces.
Given Data / Assumptions:
Concept / Approach:
If a class does not implement all interface members, it cannot be concrete; it must be declared abstract so that derived types are required to finish the job. Historically, interfaces did not contain static members or data (modern C# adds advanced features, but the exam context assumes classic rules). Multiple interface inheritance is allowed for classes and interfaces.
Step-by-Step Solution:
Verification / Alternative check:
Try compiling a non-abstract class that leaves one interface member unimplemented; the compiler errors. Marking the class abstract defers the requirement to subclasses.
Why Other Options Are Wrong:
They contradict C# interface semantics in the scope of this exam (multiple interfaces allowed; no static data in interfaces; static methods not part of the classic model).
Common Pitfalls:
Forgetting to mark a partially implementing class as abstract, leading to “does not implement interface member …” compile errors.
Final Answer:
If a class implements an interface partially, then it should be an abstract class.
Discussion & Comments