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 is ienumerable and iqueryable?

722


How to override a function in c#?

767


In how many ways you can overload a method?

820


What is ilist c#?

709


What is mvc in c#?

673


How to open a new form on button click in Windows forms?

749


How can we make a thread sleep for infinite period ?

783


Explain About .Net remoting

775


What is desktop application testing?

712


Distinguish between the Debug class and Trace class with its functionality?

784


Is dictionary a collection?

655


What is asp net c# corner?

1045


What is the use of expression tree in c#?

667


How many types of polymorphism are there?

732


What is float in unity?

697