Why does the function arguments are called as "signatures"?

Answer Posted / arul

The arguments distinguish functions with the same name
(functional polymorphism). The name alone does not
necessarily identify a unique function. However, the name
and its arguments (signatures) will uniquely identify a
function.
In real life we see suppose, in class there are two guys
with same name, but they can be easily identified by
their signatures. The same concept is applied here.
ex:
class person
{
public:
char getsex();
void setsex(char);
void setsex(int);
};
In the above example we see that there is a function setsex
() with same name but with different signature.

Is This Answer Correct ?    14 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is single and multiple inheritance?

567


Do we require a parameter for constructors?

558


What is difference between static and non-static fields of a class?

500


What is the difference between a class and an object?

533


Can we access interface static method using interface references?

534






What is early and late Binding?

578


What is the main difference between overloading and overriding?

582


Explain about encapsulation?

583


Difference between composition and inheritance ?

555


What are the access modifiers?

619


Explain serialization and overriding?

642


What is a friend function?

588


What is the super keyword?

613


What is the purpose of late binding in object-oriented programming?

569


Explain the use of Vtable and what are the various problems to override the functions?

545