Difficulty: Easy
Correct Answer: Interface members are automatically public.
Explanation:
Introduction / Context:
This checks your understanding of interface contracts in C#.NET: what they contain, their accessibility, and how a class satisfies them.
Given Data / Assumptions:
Concept / Approach:
Interface members are implicitly public and must be implemented with public members in the class. Interfaces can declare methods, properties, indexers, and events. Static is not required (and would be incorrect for instance contracts).
Step-by-Step Solution:
Verification / Alternative check:
Attempt to implement an interface with a non-public member; the compiler requires public visibility.
Why Other Options Are Wrong:
They contradict core interface rules regarding member kinds and accessibility.
Common Pitfalls:
Equating interface “inheritance” with class inheritance; forgetting that interface contracts imply public accessibility.
Final Answer:
Interface members are automatically public.
Discussion & Comments