← All notes

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

Claims

Sources

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

Permanent ID: iil:note:t0p6jxbz

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.},
}

Markdown

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.