Protected Members in Class

Salih Dincer salihdb at hotmail.com
Fri Dec 24 12:10:32 UTC 2021


On Friday, 24 December 2021 at 11:29:31 UTC, Salih Dincer wrote:
> ```d
> module app;
>
> class Any
> {
>     protected/*
>     private//*/
>     string Data;
>
>     this(string data) { Data = data; }
>
>     @property getData() { return Data; }
> }
>
> string getData(Any test) { return test.Data; }
>```

What is the difference between protected and private?  Also how 
can a function outside of the class access it?

S.Dinçer


More information about the Digitalmars-d-learn mailing list