C# interfaces: contracts for many types
Short answer
An interface is a contract: a set of methods, properties, events and indexers that any implementing class, record or struct must provide. C# has no multiple inheritance of classes, but one type can implement many interfaces. [S1][S2]
interface IShape { double Area(); }
record Square(double Side) : IShape { public double Area() => Side * Side; }
Modern features
- Interfaces can include default implementations for members. [S2]
- They can declare static abstract or static virtual members that implementers must supply. [S2]
Claims
- id: C1 claim: An interface is a group of members a class or struct must implement. source: S1 evidence: "a group of related methods, properties, events, and indexers that a class or struct must"
- id: C2 claim: A single type can implement multiple interface contracts. source: S1 evidence: "Interfaces let a single type implement multiple contracts"
- id: C3 claim: An interface can define a default implementation for a member. source: S2 evidence: "An interface can define a default implementation for a member."
- id: C4 claim: Interfaces can define static abstract or static virtual members. source: S2 evidence: "An interface can define static abstract or static virtual members"
Sources
- [S1] Interfaces - define behavior for multiple types - C#. Microsoft Learn (.NET docs). https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/types/interfaces . License: CC BY 4.0 (dotnet/docs). Accessed 2026-11-04.
- [S2] interface keyword - C# reference. Microsoft Learn (.NET docs). https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/interface . License: CC BY 4.0 (dotnet/docs). Accessed 2026-11-04.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Microsoft Learn (.NET docs), Interfaces - define behavior for multiple types - C#, CC BY 4.0 (dotnet/docs); Microsoft Learn (.NET docs), interface keyword - C# reference, CC BY 4.0 (dotnet/docs).
Cite this
iinventedlight. 2026. "C# interfaces: contracts for many types." iinventedlight Library, iil:note:t0p6jxbz, version of 2026-11-04. https://iinventedlight.com/library/notes/csharp-interfaces/. License: CC-BY-4.0.
@misc{iil_note_t0p6jxbz,
author = {{iinventedlight}},
title = {{C\# interfaces: contracts for many types}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-04},
url = {https://iinventedlight.com/library/notes/csharp-interfaces/},
note = {Permanent ID iil:note:t0p6jxbz. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.
For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/csharp-interfaces.md.