The so-called "binding": is the association of the Method Call (function call) and the Method Body (Function Ontology). If the binding occurs before the program is running, it is called "Early Binding", there is no other option, and only a secondary binding method; the binding action is performed according to the object of the program, "Late Binding", or "Run-Time Binding", or "Dynamic Binding".
All functions of Java, in addition to the function of declaring Final, belongs to the later binding, and the later binding action will occur automatically.
Final's role is to prohibit overridding of the function, and tell the compiler that the function does not require later binding, the program can get better performance, but in fact, do not bring the overall performance of the program. .
example:
Class a () {
Public void play () {
System.out.println ("a is running.");
}
Class b () extends a {
Public void play () {
System.out.println ("B Is Running.");
}
Class c () extends a {
Public void play () {
System.out.println ("C Is Running.");
}
Public class testlatebinding {
Static void play (a a) {
A.PLAY ();
}
Public static void main (String [] args) {
Play (new a ());
Play (new b ()); // Late Binding
Play (new c ()); // late binding
}
}