What is Dynamic Dispatch?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Muhammad Imran AnsariRank #326 · 7.6K reputationPosted May 13, 2025, 3:44 PM EDT
Dynamic Dispatch is a programming concept where the method that gets executed is determined at runtime, based on the actual type of the object, rather than the type the variable was declared as. Involves polymorphism and method overriding.
In simple terms:
It’s how a program decides which version of a method to call when multiple classes in a hierarchy override the same method.
class Animal { public virtual void Speak() { Console.WriteLine("Animal speaks"); } } class Dog : Animal { public override void Speak() { Console.WriteLine("Dog barks"); } } Animal myPet = new Dog(); myPet.Speak(); // Output: "Dog barks"