Internal vs. Private Access Modifiers

后端 未结 7 1464
野性不改
野性不改 2020-11-27 09:30

What is the difference between the internal and private access modifiers in C#?

7条回答
  •  生来不讨喜
    2020-11-27 09:40

    Find an explanation below. You can check this link for more details - http://www.dotnetbull.com/2013/10/public-protected-private-internal-access-modifier-in-c.html

    Private: - Private members are only accessible within the own type (Own class).

    Internal: - Internal member are accessible only within the assembly by inheritance (its derived type) or by instance of class.

    enter image description here

    Reference :

    dotnetbull - what is access modifier in c#

提交回复
热议问题