Junior From PDF OOP C# 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
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details