Google
 
   
Login
Username:

Password:


Lost Password?

Register now!
Search
Main Menu
service
top books
Polls
What do you think about php-deluxe.net?
Excellent!
Cool
Hmm..not bad
What the hell is this?
encyclopedia
recommendation
Freenet DSL
Who's Online
13 user(s) are online (12 user(s) are browsing encyclopedia)

Members: 0
Guests: 13

more...
partner

Method overloading

Method overloading is a feature found in various programming languages such as C plus plus and Java programming language that allows the creation of several subprograms with the same name which differ from each other in terms of the type of the input and the type of the output of the function.

An example of this would be a square function which takes a number and returns the square of that number. In this case, it is often necessary to create different functions for integer and floating point numbers.

Method overloading is usually associated with static typing programming languages which enforce type checking in function calls. When overloading a method, you are really just making a number of different methods that happen to have the same name. It is resolved at compile time which of these methods are used.

Method overloading should not be confused with ad-hoc polymorphism or virtual functions. In those, the correct method is chosen at runtime.