Diffrence between protected and protected internal in c#

In this tutorial we will talk about actual diffrence between protected and protected internal.

Diffrence between protected and protected internal

Protected:

1.In case of protected access is limited to the containing class or types derived from the containing class.

2.This can be accessed within same project as well as outside(by inheritance)   of the project,only access in child class(by inheritance) simply call the   method.

3.The protected member can not be accessed by creating the object of class.



Protected Internal:

1.Access is limited to the current assembly or type derive from the containing class.

2.This can also be accessed within same as well as outside the project but also can be accessed as internal.

3.Protected internal member can be accessed by creating the object in same project only.

4.It behaves like Protected+Internal.


2 Comments

Post a Comment

Post a Comment

Previous Post Next Post