+ 4

What should i do if iam not able to understand dynamic method dispatching?

23rd Mar 2017, 7:25 AM
Keerthana Nibhanapuri
Keerthana Nibhanapuri - avatar
2 Respostas
+ 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.
23rd Mar 2017, 5:57 PM
Tashi N
Tashi N - avatar
+ 1
yes
24th Mar 2017, 12:18 AM
Ali Arslan
Ali Arslan - avatar