Interface Implementation in C#

From the C# Programming Language cheat sheet · Interfaces and Abstract Classes · verified Jul 2026

Interface Implementation

Creating and implementing interfaces

csharp
// Simple interface
public interface IPlayable
{
    void Play();
    void Pause();
}

public class Video : IPlayable
{
    public void Play() => Console.WriteLine("Playing video");
    public void Pause() => Console.WriteLine("Pausing video");
}
💡 Interfaces define contracts without implementation
⚡ C# 8+ allows default interface methods
📌 Classes can implement multiple interfaces
🟢 Use interfaces for dependency injection and testing
Back to the full C# Programming Language cheat sheet