0

How is dynamic binding useful in object oriented programming? Please help

9th Feb 2018, 10:20 AM
Ann Lagat
Ann Lagat - avatar
4 Antworten
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.
10th Feb 2018, 4:49 PM
Norbivar
Norbivar - avatar
0
thank you.
16th Feb 2018, 6:11 AM
Ann Lagat
Ann Lagat - avatar
- 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 ?
19th May 2019, 8:28 AM
Dido
- 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.
4th Aug 2019, 7:42 AM
Prince Patel
Prince Patel - avatar