+ 4
What should i do if iam not able to understand dynamic method dispatching?
2 Answers
+ 12
You extend a super class and override a method of it. If you create an object of the super class or the extending class there are 2 possibilities:
1. The overridden method is called.
2. The method of the super class is called.
Java calls the method that belongs to the individual object (super method, if object is instanceof super class, overridden method if object is instanceof derived class). This is called dynamic dispatching.
+ 1
yes