Please explain what people have told you about dynamic method dispatch, and what you think it means. Then we shall know how to answer your question.
Joined: Aug 25, 2011
First of all thanks a lot.
What I have read is that here run time polymorphism is applied. As it is during the run time that it is decided which method will get overridden and get used.
From another source what I have read is that in normal cases we can use members of the base class through subclass. But in case of dynamic method dispatch we are able to access members of subclass from base class. Is it really the case? I am a bit confused with this explanation.
Thank You in advance
Joined: Oct 13, 2005
That sounds like a good description of polymorphism. I would remind you that polymorphism and overriding only apply to instance methods, not to static members or instance fields.Complete those classes, check whether I have spelt the methods the same throughout, and execute the last code snippet. Then you can see how it works.