I hv a same function name,arguments in both base class and
dervied class, but the return type is different. Can we call
this as a function overloading? Explain?
Answer Posted / vivek
Because the function caller has the option of ignoring the function return value (as demonstrated below), overloading based on function return value is not considered as a valid case to be supported by the language.
class Demo
{
int function(){ return 1; };
};
int main()
{
Demo demoObject;
demoObject.function();
return 0;
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
any one please tell me the purpose of operator overloading
What is ambiguity in inheritance?
What is multilevel inheritance in oop?
What is a superclass in oop?
What is class encapsulation?
What are benefits of oop?
What is static in oop?
Why is oop useful?
Why is abstraction needed?
Whats oop mean?
What is abstract class in oop?
Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.
What is destructor give example?
What does enum stand for?
Is html an oop?