Dynamic dispatch
In the Inheritance for reference types only section we saw how we can use inheritance with classes to inherit and override functionality defined in a super class. You may be wondering how and when the appropriate implementation is chosen. The process of choosing which implementation to call is performed at runtime and is known as dynamic dispatch.
One of the key points to understand from the last paragraph is that the implementation is chosen at runtime. What that means is that a certain amount of runtime overhead is associated with using class inheritance as shown in the Inheritance for reference types only section. For most applications, this overhead is not a concern; however, for performance-sensitive applications such ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access