Interview Questions

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

C# Interview Questions and Answers


(Continued from previous question...)

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

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.

(Continued on next question...)

Other Interview Questions