Functions, Overloading and Arguments
Function overloading or method overloading is a characteristic that was found in several programming languages like C++, Ada, C#, D and Java that permits creating various methods along with the similar name that differ from each other in the type of the input and the output of the function. It is easily defined as the ability of one function to perform various tasks.
For instance, doTask() and doTask(object O) both are overloaded methods. An object must be passed as a parameter to call the latter, while the former does not need a parameter, and is called along with a null parameter field. A general error would be to assign a default value to the object in the second method that would result in an ambiguous call error, as the compiler wouldn't know that of the two methods to use.
Another suitable instance would be a Print(object O) method. In that case one may like the method to be different when printing, for instance, pictures or text. The two different methods might be overloaded as Print(image_object P), Print(text_object T). We never have to worry about the type of the object if we write the overloaded print methods for all objects our program will "print", and the right function call again, a call is always: Print (something).