0

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?

Jens
  • 6,275
  • 2
  • 25
  • 51
  • 2
    The exact same use case as private protected in C#, nicely answered [here](https://stackoverflow.com/questions/47430491/what-is-the-use-case-for-the-c-7-2-private-protected-modifier). – Hans Passant Sep 05 '19 at 12:17
  • Thanks Hans, I somehow didn't find that question. – Jens Sep 05 '19 at 12:22

1 Answers1

1

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.

jmcilhinney
  • 50,448
  • 5
  • 26
  • 46
  • I see, that makes sense! As Hans has pointed out in a comment there also already exists the [same question for C#](https://stackoverflow.com/questions/47430491/what-is-the-use-case-for-the-c-7-2-private-protected-modifier) – Jens Sep 05 '19 at 12:25