Browse by Topic

Popular

Latest

Latest C# Posts

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
Technical illustration of C# class inheritance showing a base class and derived classes linked in a hierarchy.
C#

C# Class Inheritance: Syntax and Usage

A practical look at C# class inheritance: syntax, base constructor rules, method overriding, and common pitfalls in real-world code.

C#class inheritanceobject-oriented programmingbase class
A stack of building blocks representing base and derived classes, with arrows indicating inheritance hierarchy in C#.
C#

Understanding C# Inheritance

Learn C# inheritance fundamentals: syntax, base class constructors, virtual and override, sealed and abstract classes, and practical design tradeoffs.

Object-Oriented ProgrammingC# Classesvirtual and overridesealed classes
Diagram of a class box with a static member accessed through the class name in C#.
C#

C# Static Member Access: Syntax and Common Pitfalls

c# static member access: Learn how C# static member access works: syntax rules, static constructors, the CS0176 instance-access error, and thread-safety considerations.

C#static membersstatic constructorthread safety