Member visibility in inheritance

As we discussed earlier, in inheritance, derived classes can reuse the functionality of the parent class and use or modify the members of its parent class. But these members can be reused or modified as per their access modifier or visibility (for more details refer to Chapter 4, Day 04 - Discussing C# Class Members).

In this section, we will briefly discuss member visibility in inheritance. In any type of inheritance (that is possible in C# language) the following members cannot be inherited by base classes:

  • Static constructors: A static constructor is one that initializes the static data (refer to the Modifier section of Chapter 4, Day 04: Discussing C# Class Members). The importance of static constructors ...

Get Learn C# in 7 days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.