User-Defined Methods
From CompSciWiki
- Overview
- Writing a Method
- Calling a Method
- Methods and Scoping
- Commenting Methods
- Passing Arguments using Methods
- Review Questions and Exercises
Commenting Methods
From COMP1010 site:
Every method (except main) must begin with a prologue comment, similar to the following: /** * Describe the purpose of the method. Clearly. * * @param firstParameter description of what firstParameter means * @param secondParameter description of what secondParameter means * and so on, for all the parameters... * * @return what is the meaning of the return value? */ Parts of the prologue may be omitted if appropriate, e.g. if the method has no parameters.