Are private members inherited in C#?

Posted by Petr on Stack Overflow See other posts from Stack Overflow or by Petr
Published on 2010-06-01T14:55:30Z Indexed on 2010/06/02 9:23 UTC
Read the original article Hit count: 189

Filed under:
|
|

Just seen one tutorial saying that:

Class Dog
{
  private string Name;
}
Class SuperDog:Dog
{
 private string Mood;
}

Then there was an UML displaying that SuperDog will inherit Name as well. I have tried but to me it seems that only public members are inherited. At least I could not access Name unless it was declared as public.

© Stack Overflow or respective owner

Related posts about c#

Related posts about inheritance