Which of the following is a mechanism of static polymorphism?
By BYJU'S Exam Prep
Updated on: September 25th, 2023

Which of the following is a mechanism of static polymorphism?
- Operator overloading
- Function overloading
- Templates
- All of the above
Answer: D. All of the above
Table of content
Operator overloading, Function overloading, and Templates are the mechanisms of static polymorphism.
Solution
During compile-time, a function and an object are linked, and this process is known as static polymorphism. Static binding is another name for it. Function overloading and Operator overloading are the two methods that C# offers to implement static polymorphism.
The same function name has many definitions in the same scope due to function overloading. The types and quantity of arguments in the argument list must be different according to the function’s definition. Function declarations that merely differ in return type cannot be overloaded. Hence according to the question- Which of the following is a mechanism of static polymorphism? Operator overloading, Function overloading, and Templates are the mechanisms of static polymorphism.
☛ Related Questions: