+ 5
Help me !!
At line 2, We are using access specifier ::private,then how does output comes without any error?? https://code.sololearn.com/ca24a4138a0a/?ref=app
4 odpowiedzi
+ 2
t1,t2 are protected variables in their classes. And you are inheriting as B as protected to D so t1 becomes a protected variable to D now, D as private to DD class so t1, t2 becomes peivate variable to DD. So with in DD class you can use t1,t2 . But if you inherit DD to another class , you won't access t1,t2 in derived class because t1,t2 private in DD class. Not available to further derived class but available to DD.
Hope it make sence...
+ 2
nice support
+ 1
Yes thnx..Jayakrishna🇮🇳
+ 1
You're welcome __n