jQuery in Action, 3rd edition
The moose likes Java in General and the fly likes difference b/w early and late binding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "difference b/w early and late binding" Watch "difference b/w early and late binding" New topic

difference b/w early and late binding

Abhishek Reddy
Ranch Hand

Joined: Mar 28, 2006
Posts: 259
Can you tell me what is early and late binding and what is the exact difference between them?

Chetan Raju
Ranch Hand

Joined: Aug 02, 2006
Posts: 109
If which method to call can be decided at compile time itself, then it is called early binding. Which method to call when cannot be decided at compile time but it is decided at runtime - late binding.
Singhal Anuj

Joined: Mar 28, 2005
Posts: 8
Hope this helps.

Mr. C Lamont Gilbert
Ranch Hand

Joined: Oct 05, 2001
Posts: 1170

In Java, the choice of which method of the interface will be invoked is determined at compile time. However, the choice of on which class to invoke this method can only be determined at runtime. Furthermore, once you know which class, the JVM must still load the class which is another delay in the binding. Java is late binding.
It is sorta covered in the JavaRanch Style Guide.
subject: difference b/w early and late binding
It's not a secret anymore!