Why can?t you specify the accessibility modifier for methods
inside the interface?

Answer Posted / lakshmi

Methods that implement an interface must be declared public. The reason for this is that methods are implicitly public within an interface, so their implementation must also public. Also the return type and signature of the implementing method must match exactly the return type and signature specified in the interface definition.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Give 2 scenarios where static constructors can be used?

487


What is interface inheritance?

533


What is the use of command builder?

535


What is difference between Enum and Struct?

550


what is the meaning of Object lifetime in OOPS

535






Expalin the way you implement inheritance by using VB.NET/C#?

527


What are immutable types in c#?

483


Is exe is machine dependent?

494


What are modifiers in c#?

466


What is the difference between first and firstordefault?

430


What is unrecognized escape sequence in c#?

507


What do you mean by sealed classes and static classes?

531


What is difference between const and static in c#?

492


Explain boxing and unboxing in c#?

506


What is a static field?

504