User-Defined Methods

From CompSciWiki
Revision as of 15:53, 20 February 2007 by Umhawwv (Talk | contribs)

Jump to: navigation, search

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.