Question

Is there any direct relationship between Late Binding and Overriding, similarly for Early Binding and Overloading?

They (Binding/Overriding/Overloading) can be termed as ways to implement polymorphism, but is there any "Direct Relationship" ex: Late Binding is a sub/super concept to Overriding and vice versa etc?

Était-ce utile?

La solution

They are orthogonal (independent) concepts.

  • Overloading, Overriding: Forms of polymorphism
  • Early binding/Late binding: In the former, the method to call is known at compile time. In the latter, at runtime.

Of course, an implementation of overriding usually implies using late binding, because you will only know the object's real type at runtime. But that's just a special case.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top