Computer Science - Object Oriented Programming Using C++ - Discussion

Discussion Forum : Object Oriented Programming Using C++ - Section 1 (Q.No. 38)
38.
Overloaded functions are required to
have the same return type
have the same number of parameters
perform the same basic functions
None of the above
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
5 comments Page 1 of 1.

Sk9 said:   4 years ago
Overloaded functions can have different return types as long as the parameters are different as well, so the compiler can recognise them with their unique signature.

Dhawan said:   1 decade ago
A. Its not necessary to have same return type as return type isn't included in method signature.

B. Its not necessary to have same number of arguments in overloaded method.

C. Although its the common reason to use method overloading, however it is not necessary to use it for similar functionality.

D. Hence an answer.

R@JESH said:   1 decade ago
The answer should be "both A & B".

Raymnod said:   1 decade ago
Function overloading has to have some conditions.
1. Have the same return type
2. Have the same name.
--------------------------------
3. Different parameter is okay.
It has more details but... simply different parameter is allowed.

So, the answer is D but I think the answer should be 'A'

Shekahr said:   1 decade ago
Why c is not the answer? sum time we need basic addition of object. S1=s1+s2;.

Where s1, s2, s3 are string.

Post your comments here:

Your comments will be displayed after verification.