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 virtual?
State about java and its relation to object oriented programming?
What are the different types of inheritance?
What are different types of arguments?
How can we restrict inheritance for a class so that no class can be inherited from it?
Can we have default method with same name and signature in the derived interface as the static method in base interface and vice versa?
Explain about realistic modeling?
What is the order of call of constructors in inheritiance?
What does the keyword virtual represented in the method definition?
Do structs support inheritance?
What is the use of destructive method?
Write about abstract base classes?
What does the “abstract” keyword mean in front of a method? A class?
Explain about parametric polymorphism?
What is @functionalinterface?