Why can't I have protected interface members?

后端 未结 13 1857
走了就别回头了
走了就别回头了 2020-11-29 19:58

What is the argument against declaring protected-access members on interfaces? This, for example, is invalid:

public interface IOrange
{
    public OrangePee         


        
相关标签:
13条回答
  • 2020-11-29 20:32

    An interface is all about what a certain object can do, so when using a class which implements that interface the developer will expect all the members to be implemented, so the protected access modifier won't mean anything for interfaces.

    0 讨论(0)
提交回复
热议问题