Protected Members in Class

Paul Backus snarwin at gmail.com
Fri Dec 24 14:29:29 UTC 2021


On Friday, 24 December 2021 at 12:10:32 UTC, Salih Dincer wrote:
>
> What is the difference between protected and private?  Also how 
> can a function outside of the class access it?

`private` in D means "this symbol can only be accessed from the 
module where it's defined."

`protected` in D means "this symbol can only be accessed from (a) 
the module where it's defined, and (b) classes that inherit from 
the class where it's defined."


More information about the Digitalmars-d-learn mailing list