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 dynamic binding
Explain method overriding.
Can a class implement two interfaces having default method with same name and signature?
What are the four important foundation concepts of OOP ?
What do you mean by abstract class?
Can a class in java be inherited from more than one class?
What is a try/ catch block?
Explain what is meant by polymorphism?
What is the main difference between a class and an object?
Explain about inheritance hierarchies?
What is inheritance in java?
Explain the purpose of composition.
What is polymorphism? When is it employed? give an example.
What is super keyword?
Explain the use of Vtable and what are the various problems to override the functions?