Mid OOP

Can interfaces contain implementation (default interface methods)?

  • Yes, starting from C# 8, interfaces can have default method implementations.

interface ILogger

void Log(string message);

void LogWarning(string message) => Console.WriteLine("Warning: "

+ message);

More from C# Programming Tutorial

All questions for this course