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
Why is message passing between the objects important?
What's the order of call of constructors in inheritiance?
Explain about overriding polymorphism?
What is the difference between class inheritance and interface inheritance?
Can you give some examples of tokens?
What is operator overloading and polymorphism?
What are sealed modifiers?
What is composition? Explain the purpose of composition.
Explain about uml?
How many methods are there in the serializable interface?
What are the interfaces you used in beans?
What's the benefit of using inheritance?
What is the practical implementation of inner classes?
What is data encapsulation and what is its significance?
Why is OOP good?