This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
It has nothing to do with memory. Method overloading provides makes an API easier to use by providing the same function name to call for different parameters. If I wanted to print content to console I can use
or
It would be tedious and annoying if there was no method overloading and I had to do something like:
or
You would have a bunch of methods that do the same thing but for different input types, and all with slightly different names. Since they all conceptually do the same thing, to make it easier on the caller, we can provide 1 method name, but many different parameter inputs to handle the different types of objects with a simple API:
Please don't write "ny" for "any"; it can cause no end of confusion to people who didn't grow up speaking English and automatic tools which think it means "New York."