Reputation: 56884
I've looked and I've looked, and can't find the academic answer I'm looking for.
If a method is polymorphic:
public class Widget
{
public void doSomething()
{
// ...
}
public void doSomething(int fizz)
{
// ...
}
}
... then doSomething
can be said to be a polymorphic method of class Widget
. I am looking for the academic/mathematical term to use when referring to the different varieties of a polymorphic method. For instance, in chemistry you have the concept of isotopes which are variants of atoms that simply have different numbers of neutrons. I want to be able to say that doSomething(int)
is an x of doSomething()
, much like Tritium is an isotope of Deuterium.
What's the correct terminology for two methods that are polymorphs of one another....just polymorphs? Polymorphic conjugates??!?
I know that somewhere, somebody knows the answer to this.
Upvotes: 1
Views: 205
Reputation: 62835
Overloaded method
. Look at this wiki article.
Updated:
how do I refer to doSomething(int) from the context of doSomething()
In languages like C++/C#/Java it is common pattern:
public class Widget
{
public void doSomething()
{
// ...
int default = 42;
this.doSomething(default);
}
public void doSomething(int fizz)
{
// ...
}
}
Upvotes: 4