internal protected property still accessible from a different assembly

前端 未结 8 967
清酒与你
清酒与你 2021-02-07 09:40

I\'m setting up some demo code for a beginner session on accessibility and I found that I am able to access an internal protected property from a derived class. What am I missin

8条回答
  •  暖寄归人
    2021-02-07 10:20

    Protected means that it is shared only with descendant classes, only private means that it can't be accessed by anyone else.

    Edit: Hans comment makes your question a little more clear. When you combine modifiers like that, they combine inclusively not exclusively. It is accesse in all the ways internal or protected can be.

提交回复
热议问题