What is the use-case for Private Protected members in VB.NET 15.5?

103 Views Asked by At

VB.NET 15.5 introduced an additional access level for class members: Private Protected, as documented here and here.

An example is given as

Private Protected internalValue As Integer

My understanding is that this should be equivalent to just Protected, meaning it is accessible in the same class and its children, but not outside.

So when is this useful and what is the difference to Protected members?

1

There are 1 best solutions below

1
jmcilhinney On BEST ANSWER

The Private Protected modifier makes a class member accessible by derived types, but only within its containing assembly.

Without the Private, a Protected member is accessible to derived classes in different assemblies too.