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

Answer Posted / tsahi

Interfaces are designed to make sure a class which
implements them exposes a certain set of methods. Because
these methods are exposed, they must be public. therefore,
there is no point in implementing a method from an interface
which will be anything other than public. So all methods in
an interface are always public.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why singleton pattern is used in c#?

532


State whether it is true to test a Web service you must create a windows application or Web application to consume this service or not?

483


What does the initial catalog parameter define in the connection string?

484


In .Net, what is an assembly? Also explain the type of assembly.

515


Is unity object oriented?

487






How to transpose multi-dimensional array?

554


What does out mean c#?

478


Why do we use stringbuilder in c#?

512


What is method overriding in c#

594


Which technology is best for desktop application?

429


How can I produce an assembly?

581


What is the base class in .net from which all the classes are derived from?

498


Why ref is used in c#?

466


What is the default value of datetime in c#?

488


How to declares a two-dimensional array in C#?

563