in Dot Net by
Q:
Default interface methods in C#

1 Answer

0 votes
by

You can now add members to interfaces and provide an implementation for those members. This language feature enables API authors to add methods to an interface in later versions without breaking source or binary compatibility with existing implementations of that interface. Existing implementations inherit the default implementation. This feature also enables C# to interoperate with APIs that target Android or Swift, which support similar features. Default interface methods also enable scenarios similar to a "traits" language feature.

Default interface methods affects many scenarios and language elements. Our first tutorial covers updating an interface with default implementations. Other tutorials and reference updates are coming in time for general release.

Related questions

+1 vote
asked Jun 25, 2019 in Dot Net by Venkatshastri
  • #dotnet
  • #chash
  • #basicc#
0 votes
0 votes
asked Dec 8, 2019 in Dot Net by Sinaya
0 votes
0 votes
asked Dec 8, 2019 in Dot Net by Sinaya
0 votes
0 votes
asked Dec 8, 2019 in Dot Net by Sinaya
...