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
write a program to find 2^n+1 ?
State what is encapsulation and friend function?
What is abstraction encapsulation?
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 abstraction in oop?
What is the difference between a constructor and a destructor?
Can you explain polymorphism?
What is difference between polymorphism and inheritance?
just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required.
Get me a number puzzle game-program
What type of loop is a for loop?
What is polymorphism explain its types?
What is inheritance in simple words?
given a set based questions and 5 questions based on it next data sufficiciency questions 2 and 2/3 english sentence completion with options very easy and 2 synononmys paragraph with 10 questions 10 minutes replace =,-,*,% with -,%,+,* type questions 5 3 questions lik following itssickhere itssickthere itssickhere istsickhere which is nt alike the others very easy
hi all..i want to know oops concepts clearly can any1 explain??