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


What is difference between function overloading and overriding?



What is difference between function overloading and overriding?..

Answer / niraj verma

It is possible in C++ to use the save function name for the
no of lines for different intention. Defining multiple
function with same name is know as function overloading or
function polymorphism.

Polymorphism means one function having many forms.
The overloading function must be different in its argument
list and with different data types.

Example:
#include<iostream.h>
#include<conio.h>
int square (int);
float square (float);
void main()
{
int a = 5;
float b = 2.5;
clrscr();
cout<<"square = "<<square(a);
cout<<"\n square = "<<square(b);
getch();
}
int square(int s)
{
return (s*s);
}
float square (float j)
{
return (j*j);
}

Overloading;

Is This Answer Correct ?    9 Yes 1 No

Post New Answer

More OOPS Interview Questions

How do you make derived class as an abstract class?

1 Answers   Convergys, TCS,


WHAT IS ABSTRUCT DATA TYPE ? PLEASE EXPLAIN IT.

4 Answers   HCL,


What is a linked list?

10 Answers   IBM, Neural Info,


why to use template classes in c++?

1 Answers  


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

3 Answers   IBM, NET,


which structured data type is not used in c++? 1.union 2.structure 3.string 4.boolean

2 Answers   HCL, Wipro,


What is the correct syntax for inheritance? 1) class aclass : public superclass 2) class aclass inherit superclass 3) class aclass <-superclass

6 Answers   Wipro,


different types of castings

3 Answers   Siemens,


The type of variable a pointer points to must be the part of pointer's definition so that:

1 Answers   Infosys,


what is virtual destructor

7 Answers   L&T, TCS,


swapping program does not use third variable

5 Answers   TCS,


What is abstraction in oops with example?

0 Answers  


Categories