Early Binding Vs. Late Binding
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   devang_parikh
Posted On:   Wednesday, February 25, 2004 03:35 AM

Can anybody explain me with example what is early binding and what is late binding along with advantages of each.
I have two statement A a1 = new A() and Object o = new A() which one is early binding and which one is late. why ?

Re: Early Binding Vs. Late Binding

Posted By:   Anonymous  
Posted On:   Thursday, February 26, 2004 11:23 AM

Early Binding vs. Late Binding refers to method calls, so your examples don't apply. See http://www-2.cs.cmu.edu/People/clamen/OODBMS/Manifesto/htManifesto/node8.html for an explanation.

Re: Early Binding Vs. Late Binding

Posted By:   Bhagyashree_Jayaram  
Posted On:   Thursday, February 26, 2004 01:35 AM


The first one A a1= new A() is early binding.Meaning to say after this a1 knows which method to invoke just after compilation.



The second one Object o = new A() is late binding.That means until runtime it would not not which method needs to be called.



For example in case you have overriden equals() method.Then it comes to know that it has to invoke equals() method of A and not object would be known at the time when you are invoking it.


Hopt this helps...
Bhagya
About | Sitemap | Contact