in Dot Net by
Default interface methods in C#

▼ Show 1 Answer

0 votes

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.

Learn More with Madanswer

Related questions

0 votes
asked Feb 8, 2020 in JAVA by rahuljain1
+1 vote