Skip to content

Commit

Permalink
Add note for default interface methods
Browse files Browse the repository at this point in the history
  • Loading branch information
BillWagner committed Jul 26, 2024
1 parent 042c534 commit 14ffe1b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docs/csharp/language-reference/keywords/interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ An interface can be a member of a namespace or a class. An interface declaration

## Default interface members

These preceding member declarations typically don't contain a body. An interface member may declare a body. Member bodies in an interface are the *default implementation*. Members with bodies permit the interface to provide a "default" implementation for classes and structs that don't provide an overriding implementation. An interface may include:
These preceding member declarations typically don't contain a body. An interface member may declare a body. Member bodies in an interface are the *default implementation*. Members with bodies permit the interface to provide a "default" implementation for classes and structs that don't provide an overriding implementation.

> [!IMPORTANT]
> Adding default interfaces members forces any `ref struct` that implements the interface to add an explicit declaration of that method.
An interface may include:

- [Constants](const.md)
- [Operators](../operators/operator-overloading.md)
Expand Down

0 comments on commit 14ffe1b

Please sign in to comment.