Example:
- toUpperCase()
- println(String s)
The header of a method consists of the signature plus the description of (the type of) the result.
Example:
- String toUpperCase()
- void println(String s)
Two methods of the same class can have the same name, provided they have different signatures. Methods with the same name (but with different signatures) are said to be overloaded. For example, the substring() method in the class String.
No comments:
Post a Comment