IGDTUW 2025 — Computer PYQ
IGDTUW | Computer | 2025How many types of polymorphisms are supported by C++?
Choose the correct answer:
- A.
1
- B.
2
(Correct Answer) - C.
3
- D.
4
2
Explanation
The correct answer is B: 2.
Explanation: Types of Polymorphism
In C++, polymorphism is broadly classified into two main types based on when the binding (the association between a function call and the actual function definition) occurs.
Compile-time Polymorphism (Static Binding/Early Binding):
This type of polymorphism is resolved during the compilation process. The compiler knows which function to execute based on the function signature (name, parameter types, number of parameters).
Examples: Function overloading and operator overloading.
Mathematical representation:
Resolved_At=Compile_Time
Runtime Polymorphism (Dynamic Binding/Late Binding):
This type of polymorphism is resolved during the execution (runtime) of the program. It typically involves the use of inheritance and virtual functions. The program decides which function to execute based on the actual object type at runtime.
Examples: Function overriding (using
virtualfunctions).Mathematical representation:
Resolved_At=Run_Time
Summary Table
Type | Also Known As | Binding Time | Key Examples |
Compile-time | Static / Early | Compile time | Function/Operator Overloading |
Runtime | Dynamic / Late | Runtime | Virtual Functions (Overriding) |
By understanding these two categories, you can effectively manage how methods and operations behave in your C++ applications.
