Connecting a method call to the same method body is called a "binding" (Binding). If the binding (by the compiler and the linker, if any) is performed before the program is run, it is called early binding. You may never have heard of this term before, because it is impossible in any programmed language. The C compiler has only one method invocation, that is, "early binding."
The most puzzling part of the above program is all about early binding, because the compiler does not know exactly which method to call if it has only one instrument handle.
The workaround is "late binding," which means that the binding takes place during run time, based on the type of object. Late binding is also called "Dynamic binding" or "run-time binding." If a language implements late binding, it must also provide mechanisms to determine the type of the object during run time, and to invoke the appropriate method, respectively. In other words, the compiler still does not know the type of object at this time, but the method invocation mechanism can investigate itself to find the correct method body. Different languages differ in how they are implemented in late binding. But we can at least think of it as: they all have special types of information to be placed in the object.
All the methods that are bound in Java adopt late-binding techniques, unless a method has been declared final. This means that we don't usually have to decide whether to have late binding-it happens automatically.
Why should a method be declared final? As noted in the previous chapter, it prevents others from overwriting that method. But perhaps more importantly, it can effectively "turn off" dynamic binding, or tell the compiler that it does not need to be dynamically bound. This allows the compiler to generate more efficient code for the final method call.