Object-oriented analysis and design (OOAD) Question: Download OOAD PDF

Why does the function arguments are called as signatures?

Tweet Share WhatsApp

Answer:

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.

Download OOAD PDF Read All 63 OOAD Questions
Previous QuestionNext Question
Why should project managers complete hard problems first in an OOSAD project?Which is not an attribute of an object?
a) behavior
b) state
c) time
d) space