Answer:
Overloading happens when two or more function have the same function name but different return type and parameter.
eg: int sum(int a,int b);
int sum(int a,int b,int c);
The overloading happens in the same class i,e these function should be in the same class.
eg: int sum(int a,int b);
int sum(int a,int b,int c);
The overloading happens in the same class i,e these function should be in the same class.
Previous Question | Next Question |
How to measure 4 liters of water using a 3 liter and a 5 liter jug? | Explain Overriding? |