internal vs public in c#

前端 未结 7 1037
野趣味
野趣味 2020-11-29 04:07

I want to know the difference between the public and internal visibility modifiers.

When should we use internal on a class and

相关标签:
7条回答
  • 2020-11-29 05:04

    Public can also be accessed outside of the assembly. So when you have a class that shouldn't be accessed every class in the assembly should be able to access it, then internal is the right thing. If you need outside access, use public.

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