Dynamic binding works with which of the following OOP features?
2025
Dynamic binding works with which of the following OOP features?
- A.
Data hiding
- B.
Operator overloading
- C.
Constructor overloading
- D.
Function overriding
Attempted by 86 students.
Show answer & explanation
Correct answer: D
Dynamic binding (also known as late binding or runtime polymorphism) is a mechanism where the computer link/binds a function call to its specific implementation at runtime, rather than at compile-time.
For dynamic binding to happen, two key object-oriented programming (OOP) criteria must be met:
Inheritance & Function Overriding: A parent class and a child class must share a function with the exact same signature, where the child class overrides the behavior of the parent's method.
Base Class Pointer/Reference: A parent class pointer or reference must be used to point to a child class object.
When the overridden function is called through that pointer, the system looks at the actual object present at that moment during execution and triggers its corresponding method. This flexibility is the core foundation of runtime polymorphism.