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

What is the difference between finally and finalize block?

514


Which is faster array or arraylist in c#?

481


What is the wildcard character in sql?

519


Why objects are stored in heap in c#?

480


Why abstract class can not be instantiated?

452






What is addressof operator?

522


explain the features of static/shared classes.

501


Why singleton class is sealed?

479


What is difference between string and stringbuffer in c#?

474


How is the syntax written to inherit from a class in C#?Give an example ?

541


How do I unload an application domain?

526


How to Install uninstall assemblies into GAC?

506


How to sort an int array in c#?

535


what is the difference between interface and multiple interface?

541


In which way you can convert a value-type to a reference-type?

534