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
Explain persistence?
Can you explain primordial class loader?
Which oops concept exposes only necessary information to the calling functions?
Explain the meaning of object in object oriented programming?
Why are virtual users created?
What is constructor and virtual function? Can we call virtual funciton in a constructor?
What is the use of interface?
What is the order of call of constructors in inheritiance?
What is the difference between a class and an object?
What is the use if instanceof keyword? And how do refer to a current instance of object?
Can we override static methods? Why?
What is the practical implementation of inner classes?
Classes and structs support inheritance. Is this statement true or false?
What is inheritance in java?
What is the difference abstract class and interface?