Pages

Topics

Tools

↑↓navigate↵openescclose

C# guides

Every published C# guide, newest first, with practical examples you can copy into your own project.

3,965 guides across 14 topics

Topics

Latest C# guides

Diagram contrasting abstract class with sealed class in C# showing inheritance and override behavior
C#

C# Abstract vs Sealed: Choosing the Right Inheritance Modifier

Understand when to use abstract and sealed modifiers in C#, how they affect inheritance and overriding, and what each choice means for maintainability.

abstract classsealed classinheritanceC# modifiers
Diagram contrasting abstract and virtual method declarations in a C# base class hierarchy
C#

C# Abstract vs Virtual: Key Differences

Compare abstract and virtual methods in C#: syntax, override requirements, base calls, and when to use each for maintainable class design.

abstract methodsvirtual methodsmethod overridingpolymorphism
Diagram showing an abstract class with an abstract property declaration and derived classes with overridden implementations
C#

C# Abstract Property: Declaration and Override

Learn to declare and override abstract properties in C#: syntax, accessor override rules, abstract property vs interface property, and design tradeoffs.

abstract propertyC# OOPinheritanceoverride
Diagram showing an abstract method declaration in an abstract class being overridden by a derived class in C#.
C#

C# Abstract Method: Syntax, Overriding, and Design Tradeoffs

Learn how to declare and override C# abstract methods, how they differ from virtual methods and interfaces, and when to use them.

abstract classesmethod overridingvirtual methodsinterfaces
Illustration of an abstract class as a blueprint for derived classes in C#
C#

C# Abstract Class: When and How to Use It

c# abstract class: Learn how to declare and use C# abstract classes, when they beat interfaces, and how to avoid common design mistakes.

abstract classinheritancepolymorphismC# OOP
Diagram illustrating C# virtual method dispatch from a call site to the method table and the selected override.
C#

C# Virtual Method Dispatch Explained

c# virtual method dispatch: Understand how C# virtual method dispatch works at runtime, its performance cost, and when to use virtual methods effectively.

virtual methodsmethod dispatchpolymorphismruntime binding
A diagram showing a base class reference pointing to derived objects with dynamic method resolution at runtime.
C#

C# Runtime Polymorphism: Virtual Methods and Interfaces

Learn how C# runtime polymorphism uses virtual methods and interfaces to dispatch calls at runtime, including vtable mechanics, performance tradeoffs, and design guidance.

PolymorphismVirtual MethodsInterfacesDynamic Dispatch
Diagram showing a base class reference pointing to a derived class instance in C#.
C#

C# Base Type Reference to Derived Object

c# base type reference derived object: Learn how a C# base type reference can hold a derived object, how virtual dispatch works, and when to cast or use pattern matching.

C#polymorphismtype castinginheritance
A visual representation of C# polymorphism showing a base type reference pointing to multiple derived object types
C#

C# Polymorphism: Overloading, Overriding, and Interfaces

c# polymorphism: Learn how C# polymorphism works through method overloading, virtual dispatch, abstract classes, and interfaces, with practical examples and design gui...

C# polymorphismvirtual dispatchmethod overloadinginterfaces
Diagram comparing C# method overloading with compile-time binding and method overriding with runtime dispatch through inheritance.
C#

C# Overloading vs Overriding: Key Differences

Understand the difference between C# overloading and overriding: syntax rules, compile-time vs runtime binding, and when to use each technique.

method overloadingmethod overridingpolymorphismvirtual methods