Method overloading
Methods are distinguished by a signature – a combination of the names and the parameter types. The compiler uses these mangled names to decide on which overloaded method to use.
public int square(int y)
{
return y * y ;
}
public double square(double y)
{
return y * y ;
}
Previous slide
Next slide
Back to first slide
View graphic version