Early binding and late binding

Source: Internet
Author: User

Concept of program binding :
Binding refers to the invocation of a method associated with the class (method body) in which the method resides. For Java, bindings are divided into static and dynamic bindings, or pre-and late-binding.

Static bindings :
The method is already bound before the program executes, and is implemented by the compiler or other linker. For example: C.
For Java simple can be understood as the program compile time of the binding; In particular, the Java method is only final,static,private and the constructor method is pre-binding

Dynamic binding :
Late binding: Binds at run time based on the type of the specific object.
If a language implements late binding, it must also provide mechanisms to determine the type of the object during run time and invoke the appropriate method, respectively. That is, the compiler still does not know the type of the object at this point, but the method invocation mechanism can investigate itself and find the correct method body. Different languages have a difference in how late binding is implemented. But at least we can think of it: they all have special types of information in the object.


the process of dynamic binding :
A method table that extracts the actual types of objects from a virtual machine;
Virtual machine Search method signature;
Invokes a method.

About the specific process of dynamic binding JVM operation, I do not quite understand, later understand not on.

Attached reference connection: http://www.cnblogs.com/yyyyy5101/archive/2011/08/02/2125324.html

Early binding and late binding

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.