Question What is Overloading |
| Overloading is a polymorphic technique in which user can able to define a function with same name but different signatures. |
| Overloading is a polymorphic technique in which user can able to define a function with same name but different signatures. |
| nvbnvbnvbnvbnvb |
| nvbnvbnvbnvbnvbfdgdfgdfgdfgdfgfd |
| Example :
Function Test(Num1 as integer,Num2 as integer)
Function Test(Num1 as integer,Num2 as integer,Num3 as integer)
Same name different signatures
|
| overloading is one when function with the same but with some changes |
| in overloading, you can declare multiple fuction in a same class having same function name but redeffination must have different function signature like types of parameter, oder of parameter, number of parameter. |
| There are 2 types of overloading :
1. Function Overloading :
When we define functions with the same name but having different signature (having different argument types ,argument numbers, argument order)it is called Function Overloading.
E.g. int sum(int,int)
int sum(int,int,int)
2. Operator Overloading :
It allows to treat user - defined data type as basic data type .
E.g. String s1,s2;
String s = s1 + s2;
|
| overloading means same function name but its argument is different with in in the same calass
|
| jkhjkh |
| jkhjkh |
| Using overloading you can use same function name with different signatures. So that you can use it on different set of condition . for eg.
char * add(char *,char *); // to add two char arrays
int add(int,int); // to add two integers
double add(double,double); // to add two double |
| Overloading is nothing but the methods of class contains same name, but different parameters |
| overloading means using same name but may behave differently. |
| test |
| Function Overloading: Having functions with the same name but different in signature. |