# Polymorphism with Interfaces

An interface can be a variable's, parameter's or list's type, so it can hold objects of unrelated classes that keep the same contract. Depending on an interface, such as IClock, lets a test pass any fake that implements it.

![Cheat sheet: Polymorphism with Interfaces](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/d5d53606cbbe480cbd0fce5fffa7e453.webp)

- Category: C#
- Level: Freelancer
- Tags: c-sharp, Dependency Injection (oop), OOP, Polymorphism (c-sharp)
- Updated: November 3, 2026

Source: https://www.ask-codey.com/cheat-sheets/interfaces-in-csharp-polymorphism-with-interfaces-cheat-sheet
