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

How does abstraction differ from encapsulation.

736


When will you use an interface and abstract class?

729


Explain about realistic modeling?

739


What are abstract functions? Why are they used?

766


Explain about multiple inheritance?

816


What is a constructor in class?

774


What is a static method? Why do we need static methods in java 8 interfaces?

886


Define Data Abstraction. What is its importance?

728


What is Abstract method and how different from Virtual Method?

681


What is the difference between class inheritance and interface inheritance?

780


What is composition? Explain the purpose of composition.

742


Is is possible to define our own functional interface?

765


What is the difference between function overloading and over riding?

748


What is abstraction? How does it differ from encapsulation

703


What is the difference between public, private and protected access modifiers?

760