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
How does abstraction differ from encapsulation.
When will you use an interface and abstract class?
Explain about realistic modeling?
What are abstract functions? Why are they used?
Explain about multiple inheritance?
What is a constructor in class?
What is a static method? Why do we need static methods in java 8 interfaces?
Define Data Abstraction. What is its importance?
What is Abstract method and how different from Virtual Method?
What is the difference between class inheritance and interface inheritance?
What is composition? Explain the purpose of composition.
Is is possible to define our own functional interface?
What is the difference between function overloading and over riding?
What is abstraction? How does it differ from encapsulation
What is the difference between public, private and protected access modifiers?