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
What is difference between abstraction and encapsulation?
What is a class oop?
program for insertion ,deletion,sorting in double link list
What is encapsulation and abstraction? How are they implemented in C++?
hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.
Can an interface inherit a class?
What is the benefit of oop?
What are the benefits of oop?
What is class in oop with example?
What is difference between inheritance and polymorphism?
Will I be able to get a picture in D drive to the c++ program? If so, help me out?
How do you use inheritance in unity?
What is multilevel inheritance explain with example?
Whats oop mean?
What is encapsulation with real life example?