Skip to main content
1 of 3
Dave Clarke
  • 20.3k
  • 4
  • 68
  • 113

Overloading is when two or more methods have the same name but different signature (different argument types, different number of arguments). Overloading is resolved statically, depending only on the static types of the arguments.

Multimethods occur when two or more methods have the same name, the same number of arguments, and overlapping type signatures. Multimethods are resolved dynamically, the most suitable method is chosen depending on the runtime types of the arguments. All arguments are used to determine which method body to run. This differs from traditional single dispatch in Java, where only the first argument (the target) of the method is used to determine which method body is run.

Dave Clarke
  • 20.3k
  • 4
  • 68
  • 113