What is difference between function overloading and overriding?
Answer Posted / 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 View All Answers
How is class defined?
How do you define social class?
What are objects in oop?
can we make game by using c
What is the fundamental idea of oop?
Why oops is important?
Why is abstraction used?
Explain the concepts involved in Object Oriented programming.
What is overloading in oop?
What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?
which feature are not hold visual basic of oop?
hi all..i want to know oops concepts clearly can any1 explain??
Prepare me a program for the animation of train
What is the main feature of oop?
What is static modifier?