Function Overloading

A function name having several definitions in the same scope that are differentiable by the number or types of their arguments is said to be an overloaded function. Process of creating overloaded functions is called function overloading. Overloaded functions have same name but different signatures. The argument types are said to be part of the function’s extended name. Function overloading reduces number of comparisons in a program and thereby making the program run faster. Function overloading is one of the ways by which Java implements polymorphism. To remove the complexity of naming, we use functions with the same name for similar operations. In Java, function overloading means creating more than a single method with the same name but different signatures. We cannot overload method just by changing the return-type. The overloaded function must differ either by the no. of parameters or data types.

Binding refers to the linking of a procedure call to the code to be executed in response to the call. In early binding, the binding of identifiers is done at the compile time. In late binding, the binding is done at the run time. In function overloading, the binding of functions is done at the compile time. So, it follows static binding or early binding.

To Access the full content, Please Purchase