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...


class base
{
public:
int fun(int)
{}
};
class base2
{
public:
int fun(float)
{
}
};
so here qustion is both function either function
overloading or over riding;

Answers were Sorted based on User's Feedback



class base { public: int fun(int) {} }; class base2 { public: int fun(float) { } }; so ..

Answer / utpal kashyap

Overloading...
Because Function overloading depends upon type of parameters/number of parameters (NOT type of function) passed in function, So this is the example of function overloading.

Is This Answer Correct ?    11 Yes 3 No

class base { public: int fun(int) {} }; class base2 { public: int fun(float) { } }; so ..

Answer / adarsh gumashta

Overloading would be possible if class 2 extended class1
but in the case its not there . so neither overloading nor overriding .

http://stackoverflow.com/a/14181786

Is This Answer Correct ?    3 Yes 0 No

class base { public: int fun(int) {} }; class base2 { public: int fun(float) { } }; so ..

Answer / sandeep mannarakkal

Over loading and overriding , both are performing in the same scope, here both functions have different scope.
So it is NOT overloading ,
NOT over riding.

Is This Answer Correct ?    0 Yes 0 No

class base { public: int fun(int) {} }; class base2 { public: int fun(float) { } }; so ..

Answer / keerthi

overriding

Is This Answer Correct ?    0 Yes 8 No

Post New Answer

More C++ General Interview Questions

Which c++ operator cannot overload?

0 Answers  


What is the difference between reference type and pointers.

4 Answers   HCL,


How do you add an element to a set in c++?

0 Answers  


Why do we use constructor?

0 Answers  


What is Object Oriented programming.what is the difference between C++ and C?

8 Answers   Infosys,


Is c++ a good beginners programming language?

0 Answers  


How are virtual functions implemented in c++?

0 Answers  


What is the use of setprecision in c++?

0 Answers  


Explain stack & heap objects?

0 Answers  


What are advantages of C++ when comparing with C?

18 Answers   HP, iGate, TCS,


Describe the advantage of an external iterator.

0 Answers  


What is the best ide for c++?

0 Answers  


Categories