Method signature

Edit on Github instead

The general form of a method signature is:

<methodName>(<parameterTypeList>)

Examples of method signatures are:

celsiusTempConverted(int)
celsiusTempConverted(double)
turnLeft()
turnDegrees(int)
numberTripled(int)

Method names can be the same, but method signatures – the name and the parameter type(s) – must be different.

If a method name takes different parameters, we say that method has been overloaded.

Suggest changes

Related links

URL Topic Source