KnowledgeBoat Logo
|

Computer Applications

What is the role of a function's signature in disambiguation process?

User Defined Methods

12 Likes

Answer

The key to function overloading is a function's signature. The signatures can differ in the number of arguments or in the type of arguments, or both. To overload a function name, we need to declare and define all the functions with the same name but different signatures, separately.

At the time of function call, the compiler matches the signature of overloaded function with the signature of the method call statement and executes the function with the matching signature.

Answered By

8 Likes


Related Questions