0

Since C# 8.0, now we can have default implementation in interface. Does that mean there won't be any difference between interface and abstract class usage?

default interface methods

Anil Soman
  • 2,443
  • 7
  • 40
  • 64
  • 2
    The default implementation is only accessible if the object reference has the interface type. An abstract class will not have access to that implementation without an explicit cast (like with any explicit interface implementation). e.g., `((ITheInterface)this).SomeDefaultImplementation()` – Jeff Mercado Oct 21 '22 at 04:21

0 Answers0