C# (Sharp) Programming Language Question:
Download Questions PDF

Why cannot you specify the accessibility modifier for methods inside the interface?

Answer:

They all must be public. Therefore, to prevent you from getting the false impression that you have any freedom of choice, you are not allowed to specify any accessibility, it is public by default.

Download C# (Sharp) Programming Language Interview Questions And Answers PDF

Previous QuestionNext Question
How do I create a multilanguage, single-file assembly?Is it possible to restrict the scope of a field/method of a class to the classes in the same namespace?