O'Reilly logo

C# Primer Plus by Klaus Michelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Method Overriding and Overloading Are Different Mechanisms

It is important to distinguish between method overloading presented in Chapter 12, “Class Anatomy Part I: static Class Members and Method Adventures,” and method overriding presented in this chapter. As noted in Syntax Box 16.2, an overriding method must have the same name and the same set of formal parameter types as the virtual base class method. In contrast, an overloading method has the same name but a different set of formal parameter types.

So if you included a method in your derived class that had the same name as a method in the base class but different formal parameter types, the method of the base class would not be overridden by the derived class method because of the differing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required