Re: private instance variable of derived class not always returned by base class getter?



Piet wrote:

Each of the derived classes has a special
combination of private instance variables than can be accessed through
getters declared in the base class.

That's not possible. Private members can only be seen inside the
same class. The getters and setters of the base-class can only
access the private member of the base-class.


Regards, Lothar
--
Lothar Kimmeringer E-Mail: spamfang@xxxxxxxxxxxxxx
PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)

Always remember: The answer is forty-two, there can only be wrong
questions!
.



Relevant Pages

  • private field is never assigned ; force comiler to stop complaining?
    ... know if there is a more relevant group. ... I have a series of private members in my class, ... reflection in a base class. ... basis for supressing or eliminating the compiler warning. ...
    (microsoft.public.dotnet.general)
  • Re: Having problem getting private members using reflection.
    ... Private members from the concrete class or the base class? ... there's one last bit of detail where private base class members are inaccessible via reflection on the derived type. ... I did some digging and the MSDN documentation states that the caller must have ReflectionPermission in order to get the private members of a class. ... Could someone please clarify on what I need to do in order for my code to be able to parse private members of my Page using reflection? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: OO Design question
    ... Today your base class *only* has common data. ... Pure data-only objects are well-expressed using structs. ... instantiating your structs as private members of the base class, ... also happens to be far more flexible than using multiple levels of ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: When should we use the single inheritance v.s private members
    ... In case of single inheritance u can call functions of base class ... I am sending u the code so u can understand the logic when use single inheritance or when use private members as containers.. ... int main(int argc, char* argv[]) ...
    (microsoft.public.dotnet.languages.vc)