Chapter 9. Overloading Class Members and Operators

In This Chapter

  • Overloading Methods

  • Overloading Indexers

  • Overloading Operators

  • Resolving Overloaded Members

Overloading is the capability of a program to define more than one member of the same name within the same class. The only difference among multiple overloaded members is that they have different argument types, a different number of arguments, or both. Over-loaded members may not differ by return type alone, as this would cause ambiguity by not knowing which method should be called.

Of special note is the difference between overloading and overriding. Although their names may sound the same, they are very distinct concepts. In overriding, a derived class implements functionality, which can ...

Get C# Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.