Browse by Topic

Popular

Latest

Latest Posts

Diagram showing a base class method marked virtual being overridden by a derived class implementation.
C#

c# virtual keyword: How Overridable Members Work

Learn how the c# virtual keyword enables method overriding and polymorphism, including syntax, runtime dispatch, and common design pitfalls.

virtual methodspolymorphismmethod overridinginheritance
C# class inheritance diagram showing access modifiers controlling member visibility from derived classes
C#

C# Access Modifiers in Inheritance

Understand how C# access modifiers behave in inheritance: which members derived classes can see, how overriding interacts with accessibility, and when to use protected internal or private protected.

C# inheritanceaccess modifiersprotected membersvirtual and override
Illustration of a C# class hierarchy with protected members visible only to derived classes, shown as a shield around the base class.
C#

C# Protected Inheritance: Access in Derived Classes

Understand how the protected access modifier works in C# inheritance, including access rules, derived class usage, and design tradeoffs.

C# inheritanceprotected access modifieraccess modifiersderived classes
Diagram showing a single inheritance chain in C# with multiple interface blocks attached to one class node, illustrating the alternative to multiple inheritance
C#

Multiple Inheritance in C#: What to Use Instead

C# classes support only single inheritance. This article explains why, and how interfaces, default interface methods, composition, and extension methods provide alternatives.

C# inheritanceinterfacescompositiondefault interface methods
Diagram showing a sealed method preventing a derived class from overriding it
C#

C# Sealed Method: Preventing Overrides

Learn how to declare a sealed method in C#, what it prevents, and when to use it to control inheritance behavior.

C#sealedinheritanceoverride
A C# sealed class symbol with a lock icon representing prevention of inheritance.
C#

C# Sealed Class: When and Why to Use It

Practical examples show how the C# sealed modifier prevents inheritance, affects performance, and guides class design choices.

sealedinheritanceC# designclass modifiers
Diagram showing the order of constructor execution in C# inheritance, with base class constructor running before derived class constructor.
C#

C# Inheritance Constructor Order

Learn how C# constructor order works with inheritance: base constructors run first, derived constructors run after, including the base keyword and virtual call pitfalls.

C#InheritanceConstructorsObject Initialization
Diagram showing a derived class box pointing upward to a base class box through a labeled base keyword arrow in C#
C#

C# Base Member Access: Syntax, Usage, and Limits

c# base member access: Learn how the base keyword in C# accesses base class members: constructor initializers, overridden methods, fields, properties, and its limitati...

C#base keywordinheritancevirtual methods
Illustration of the C# base keyword showing a derived class calling its base class method.
C#

Using the C# Base Keyword Correctly

Learn how to use the C# base keyword to call base constructors, methods, and properties, and avoid common pitfalls. Practical code examples included.

C# inheritancebase keywordconstructor chainingmethod overriding
Illustration of a code editor with a C# class inheritance diagram, showing a base class and derived class relationship.
C#

C# Inheritance: How Base Classes and Derived Classes Work

Learn how base and derived classes work in C#: constructor chaining, virtual and override members, the base keyword, casting, and when inheritance makes sense.

C# inheritancebase keywordvirtual methodspolymorphism