Bird
0
0

Why can't interface methods have access modifiers like 'public' or 'private' in their declaration?

hard🧠 Conceptual Q10 of 15
C Sharp (C#) - Interfaces
Why can't interface methods have access modifiers like 'public' or 'private' in their declaration?
ABecause interface methods are implicitly public and cannot have other access levels
BBecause interfaces are private by default
CBecause methods in interfaces must be static
DBecause access modifiers are only for classes
Step-by-Step Solution
Solution:
  1. Step 1: Explain interface method access rules

    Interface methods are implicitly public by design for contract enforcement; explicit modifiers contradict this and are disallowed.
  2. Final Answer:

    Because interface methods are implicitly public and cannot have other access levels -> Option A
  3. Quick Check:

    Interface methods are always public implicitly [OK]
Quick Trick: Interface methods are always public, no modifiers needed [OK]
Common Mistakes:
MISTAKES
  • Thinking interfaces are private
  • Assuming interface methods must be static
  • Believing access modifiers apply only to classes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Sharp (C#) Quizzes