0
How is dynamic binding useful in object oriented programming? Please help
4 Réponses
0
Dynamic binding (also known as late-binding) allows you runtime lookup of virtual functions.
In a more understandable way: it allows you to have virtual functions in parent classes which can be overriden in derived classes. Calling such a function through a pointer/reference to the base class (= polymorphism) allows the calling of the appropriate childs overriding function.
0
thank you.
- 1
I still don't understand why we need dynamic binding... why we just don't instantiate the child class and use its overridden method e.g. Child child = new Child() --> child.@method()
Why we need this complication - Parent parent = new Child() --> parent.method() as in both cases we get access to the overridden method ?
- 1
Dynamic binding means linking of producer cause to the code to be executed in response to the call.It is also known as late binding.