4. Overriding vs overloading
• Overloading a method (or function) in C++
is the ability for functions of the same
name to be defined as long as these
methods have different signatures
(different set of parameters). Method
overriding is the ability of the inherited
class rewriting the virtual method of the
base class.
5. Overriding vs overloading
• In overloading, there is a relationship
between methods available in the same
class whereas in overriding, there is
relationship between a superclass method
and subclass method.
6. Overriding vs overloading
• Overloading does not block inheritance
from the superclass whereas overriding
blocks inheritance from the superclass.
7. Overriding vs overloading
• In overloading, separate methods share
the same name whereas in overriding,
subclass method replaces the superclass.
8. Upcasting in C++
• Upcasting is using the Super class's
reference or pointer to refer to a Sub
class's object. Or we can say that, the act
of converting a Sub class's reference or
pointer into its Super class's reference or
pointer is called Upcasting
9. • Overloading must have different method
signatures whereas overriding must have
same signature.