문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top