Use of a virtual function implies _____.

2018

Use of a virtual function implies _____.

Answer: D. Dynamic bindingCorrect answer: Dynamic binding. A virtual function makes the function call resolve at runtime according to the actual object type. That runtime resolution is…

  1. A.

    Overloading

  2. B.

    Overriding

  3. C.

    Static binding

  4. D.

    Dynamic binding

Attempted by 756 students.

Show answer & explanation

Correct answer: D

Correct answer: Dynamic binding.

A virtual function makes the function call resolve at runtime according to the actual object type. That runtime resolution is called dynamic binding.

  • Overriding: closely related, because a derived class may override the virtual function. But overriding is the redefinition itself, not the binding mechanism asked by the stem.

  • Dynamic binding: the mechanism enabled by virtual functions, where the final method body is selected during execution.

  • Overloading/static binding: resolved at compile time, so they are not implied by virtual functions.

Therefore, the best answer is Dynamic binding.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Bpsc

Loading lesson…