Meaning of Overloaded Methods

A method name may be overloaded based on the type and number of parameters it takes. The question is are those

  1. Separate methods which you can distinguish based on usage.
  2. A single method with multiple uses.

The question becomes important when you imagine passing method objects around. Can you pass a single overloaded method so that it may be used in multiple ways? Or can you only pass a single version of that method?

Resolution:

They are separate methods. They have totally different bodies and it is only the programmer who makes associations between them. Also this allows for the connection between methods and classes based on patterns. The problem of if an overloaded method may be passed around may be fixed by a special feature which fakes overloaded method passing (if needed).



jwalker@cs.oberlin.edu