please consider the following paragraph from kb6 book page no. 115, table 2-3
Reference type determines which overloaded version (based
on declared argument types) is selected. Happens at compile
time. The actual method that’s invoked is still a virtual method
invocation that happens at runtime, but the compiler will
already know the signature of the method to be invoked. So at
runtime, the argument match will already have been nailed
down, just not the class in which the method lives.
what does it mean? specifically what is "virtual method" ? secondly what does the last line means when the author says "nailed down, just not the class in which the method lives" ?
At compile time, it detects which overloading method to be invoked for the given reference (The reference on which the method gets called). Runtime determines which class' method should be called. This depends on the object referred to by the reference.