hamburger

Runtime Polymorphism is Achieved by _____

By BYJU'S Exam Prep

Updated on: September 25th, 2023

  1. Friend function
  2. Virtual function
  3. Operator overloading
  4. Function overloading

Runtime polymorphism is achieved typically by Virtual function. A member function which you expect to be redefined in derived classes.

All About Friend function, Virtual function, Operator overloading, Function overloading

Friend function:

The private and protected data of a class can be accessed using a function if it is declared as a friend function.

Runtime polymorphism:

When a call to an overridden method is made, runtime polymorphism resolves the call during runtime rather than at compile time.

Virtual functions are used to achieve runtime polymorphism.

Virtual function:

Runtime polymorphism is typically achieved through virtual functions.

Operator overloading:

Redefinition of operators is made possible by operator overloading.

Operator overloading is used to provide compile-time polymorphism.

Function overloading:

Function overloading lowers the cost of using multiple functions to execute comparable tasks under various function names.

Operator overloading is used to provide compile-time polymorphism.

Summary:-

Runtime polymorphism is achieved by _____ 1. Friend function 2. Virtual function 3. Operator overloading 4. Function overloading

Virtual function achieves the Runtime polymorphism. It is a member function which is expected to be redefined in derived classes.

Related Questions:-

Our Apps Playstore
POPULAR EXAMS
SSC and Bank
Other Exams
GradeStack Learning Pvt. Ltd.Windsor IT Park, Tower - A, 2nd Floor, Sector 125, Noida, Uttar Pradesh 201303 help@byjusexamprep.com
Home Practice Test Series Premium