Skip to content
Advertisement

Protected in Interfaces

Why are all methods in an interface definition implicitly public? Why does it not allow a protected method?

Advertisement

Answer

Because an interface is supposed to mean “what you can see from outside the class”. It would not make sense to add non-public methods.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement