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

Answer Posted / karans

All members of an interface is marked as public because :
1) If Private :- The members ca not be implemented into
child class (as private members are derived into child
class).
2). If Protected :- The members can not be accessed by
instance of the class implementing members of that
interface (as protected members become private into
inherited class) even the members will not be inherited
into other child classes of class implementing interface.
c). If Public :- The members can be implemented into
child classes and can be accessed by instances of that
class as well as can be inherited into child class of that
class.

So All the members of Interface are bydefault considered
as PUBLIC.

Is This Answer Correct ?    11 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is c++ or c# better?

543


What is a framework in c#?

471


What is the difference between static class and sealed class in c#?

472


What is the purpose of static?

503


Compare and contrast between the System.Array.CopyTo() and Clone()?

553






What framework is used for performance testing/load testing?

1482


Why would you use untrusted verification?

536


What is IL / CIL / MSIL?

667


Explain how to implement delegates in c#.net

501


What is dbml file in c#?

540


Which debugging tools you can use in the .NET ssSDK?

553


What is the difference between interface and abstract class in c#?

465


What is an argument in c#?

473


what is IComparable

557


What is the purpose of dictionary in c#?

459