Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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?

Answers were Sorted based on User's Feedback



I hv a same function name,arguments in both base class and dervied class, but the return type is di..

Answer / ravi kumar noneria

No,
if two functions with same name has either diff no of
argument or same no of arguments but different type is
called function overloading not return type.

Is This Answer Correct ?    5 Yes 0 No

I hv a same function name,arguments in both base class and dervied class, but the return type is di..

Answer / 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

I hv a same function name,arguments in both base class and dervied class, but the return type is di..

Answer / pankaj shinde

No.
for overloading two methods should be in same class
and not in base & derived class

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More OOPS Interview Questions

WAP to generate 2n+1 lines of the following pattern on the computer screen:

2 Answers  


How to reverse a sentence in c program ex: ram is a good boy answer: boy good a is ram

0 Answers   IBM,


What is difference between pop and oop?

0 Answers  


assume the program must insert 4 elements from the key board and then do the following programs.sequential search(search one of the elements),using insertion sort(sort the element) and using selection sort(sort the element).

0 Answers  


What is an example of genetic polymorphism?

0 Answers  


Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)

0 Answers   HCL,


How do you define a class in oop?

0 Answers  


difference between structure and union.

2 Answers   ADP, Convergys,


WHAT IS ABSTRUCT DATA TYPE ? PLEASE EXPLAIN IT.

4 Answers   HCL,


What is persistence in oop?

0 Answers  


how to find no of instances of an object in .NET?

1 Answers   Infosys,


explain defference between structure and class with example

2 Answers  


Categories