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

What are virtual destructors?

509


How can you write a class to restrict that only one object of this class can be created (Singleton class)?

518


What is desktop application testing?

488


What is thread safe in c#?

491


How does bitwise work?

506






What is the difference between decimal and integer?

524


Why dictionary is faster than list?

556


Differentiate between the public and private ?

563


Is int a class in c#?

505


What does m mean in decimal c#?

498


What is the meaning of 0 in c#?

533


What does the parsefloat function do?

493


What is tuple in c#?

532


What is namespace give the example?

462


Is it true that all c# types derive from a common base class?

530