Chapter 15
Overloading
We say a term is overloaded if it has many different meanings.1 A glance in any dictionary will show that many words in the English language are overloaded, and the meaning of a word in a particular situation is determined by context. In programming languages it is usually function or method names that are overloaded. As with words in English, a compiler will use contextual information to determine the exact meaning.
1. The term polymorphism is, for example, overloaded.
Overloading and overriding are both techniques that take a function or method named in a specific invocation and select for execution one out of potentially many different function bodies. But the two mechanisms differ in several regards. Most importantly, ...
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