Take the 2-minute tour ×  What is meant by virtual table
resolution strategy used by JVM ? Can somebody explain in detail
?  share|improve this question  1 Answer 1  up vote 5 down vote
accepted  Basically any method that is not declared final can be
overriden in any inheriting class. A virtual table resolution
strategy is how Java dynamically dispatches method invocations
to the method definition of the runtime type of the object. For
example, if you have an object s that is declared to be of type
Shape but was instantiated as new Circle() (i.e. Shape s = new
Circle()) and then you invoke s.draw()... if Circle overrides
draw, you want the Circle's version of the draw method to be
invoked and not the Shape's version of that method. This
information can only be figured out at runtime (if you are
passed a Shape object, it could be passed in from a JAR that the
compiler never sees, so the compiler has no way of figuring out
what specific subclass of Shape was instantiated), and so it is
up to the VM to dispatch