Yes. C# supports polymorphism through overloads, generics, delegates, and pattern-based features without requiring a shared interface or base class. Example using a delegate strategy: public static decimal Checkout( decimal subtotal, Func<decimal, decimal> discount) => discount(subtotal); decimal total = Checkout(100m, value => value * 0.90m); Generic code is another form: static T Last<T>(IReadOnlyList<T> items) => items[^1]; These approaches work when behavior can be supplied directly or the algorithm is type-independent. Interfaces remain valuable when multiple types must advertise a stable capability; do not reject them merely to achieve polymorphism another way.
Backbencher Developer · · 0 likes