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
What is a pure virtual function?
What are virtual functions, base class pointer, derived class pointer, biding references?
Write a note about inheritance?
How to define an abstract class?
What is the difference abstract class and interface?
Can you create an instance of an interface?
How to make a class accessible as a web service?
What are the major differences between late and dynamic binding?
What is serialization? How do we implement serialization actually?
What is an abstract property. Give an example?
Can you instantiate an abstract class and what is an inner class?
What are all the languages which support oop?
Can a function be overloaded based on return types?
Can an interface inherit from another interface?
Explain about a class?