Correct option is D
Function overloading is a feature in programming languages like C++ that allows multiple functions to have the same name but differ in their parameter types, numbers, or both. This enables the same function name to perform different tasks based on the context.
Important Key Points:
1. Overloading increases code readability and reusability by using the same function name for different purposes.
2. The compiler differentiates overloaded functions by their signatures (number and types of parameters).
3. Overloading is specific to functions and operators, not variables or classes.
Knowledge Booster:
1.
Variable: Cannot be overloaded because variables must have unique identifiers in the same scope.
2.
Objects: Are instances of classes and do not support overloading.
3.
Class: Does not support overloading directly, though methods within a class can be overloaded.
4. Function overloading is different from
function overriding, which occurs in inheritance when a derived class redefines a base class function.