Method Overriding (Cont.)


Polymorphism vs Overriding
Method overriding is a form of polymorphism which dynamically binds method from the subclass in response to a method call from subclass object referenced by superclass type.

Polymorphism vs Overloading
Method overloading is another form of polymorphism. For overloading, you also got multiple methods with the same name but different method signature but a call to correct method is resolved at compile time using static binding, while dynamic binding is for overriding.

Overloading vs Overriding
Overloading is about same function have different signatures. Overriding is about same function, same signature but different classes connected through inheritance.

Rules for Method Overriding
The following rules for method overriding will be detailed next: