हिंदी

Function Overloading

Advertisements

Topics

Function Overloading:

C++ and Java facilitate designing a number of functions with the same function name. However, their parametric types must be different. Such functions are called overloaded functions, and the process is said to be function overloading. 

Need to use Overloaded Functions 

As we know, an object contains a state and behaviour (data and functions). Sometimes, it is intended to perform similar operations with a slight change in the parameters. Hence, it is reliable to use many functions with the same name for similar operations. 

Defining Overloaded Functions 

A method header contains a method name and several parameters. The methods with the same name are treated to be the same, if the types and the number of parameters are the same. Hence, the parameter list must be different in their types or numbers while defining overloading functions. 

If you would like to contribute notes or other learning material, please submit them using the button below.
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×