Junior OOP

What is interface default implementation and why was it introduced?

  • Allows interfaces to provide default method implementations.
  • Reason: Enables adding new methods to interfaces without breaking existing

implementations.

interface IPrinter

void Print(string msg);

void PrintInfo(string msg) => Console.WriteLine("Info: " + msg);

// Default

More from C# Programming Tutorial

All questions for this course