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?

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


Please Help Members By Posting Answers For Below Questions

Why it is called runtime polymorphism?

1139


What are the benefits of polymorphism?

1278


What is encapsulation in oops?

1015


Can bst contain duplicates?

1197


How Do you Code Composition and Aggregation in C++ ?

25478


What are properties in oop?

1089


What is and I oop mean?

1210


Templates mean

2087


What is encapsulation in oop?

1054


What are the two different types of polymorphism?

1145


Why do we use class?

1090


What does and I oop and sksksk mean?

1162


What is coupling in oops?

1156


if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?

3531


How do you define a class in oop?

1126