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
Discussion:
5 comments Page 1 of 1.
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.
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.
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'
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'
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.
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.
Where s1, s2, s3 are string.
R@JESH said:
1 decade ago
The answer should be "both A & B".
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers