Can a C# class call an interface’s default interface method from its own implementation?

As far as I know you can’t invoke default interface method implementation in inheriting class (though there were proposals). But you can call it from inheriting interface: public class HappyGreeter : IGreeter { private interface IWorkAround : IGreeter { public void SayHello(string name) { (this as IGreeter).SayHello(name); System.Console.WriteLine(“I hope you’re doing great!!”); } } private … Read more

Default Interface Methods. What is deep meaningful difference now, between abstract class and interface? [closed]

There is not a lot of difference between the two apart from the obvious fact that abstract classes can have state and interfaces cannot. Default methods or also known as virtual extension methods have actually been available in Java for a while. The main drive for default methods is interface evolution which means being able … Read more