- Home/
- CDS & Defence/
- Article
Runtime Polymorphism is Achieved by _____
By BYJU'S Exam Prep
Updated on: September 25th, 2023
- Friend function
- Virtual function
- Operator overloading
- Function overloading
Runtime polymorphism is achieved typically by Virtual function. A member function which you expect to be redefined in derived classes.
Table of content
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:-
- ‘2,4-D’ is a _______
- Bill Receivable Account is ______.
- Masculine of ‘Bee’ is _____________.
- Which of the following has the Highest Density? 1. Coke 2. Graphite 3. Charcoal 4. Diamond
- Which one of the following is NOT a Technique of Inventory Control?
- With Reference to the history of India, the terms Kulyavapa and Dronavapa denote