...
Block Comments are useful when making multiple line comments. When making a block comment, it begins with "/*" and ends with "*/". Everything in between these symbols is considered a comment. This is useful when you are testing and need to comment out a large block of code.
|
Line Comments
An Line Comment is great when commenting one line of code. A line comment is created with two forward slashes, "//". Everything after the double forward slashes is considered a comment for the rest of the line. For example:
|
"JavaDoc" Style Comments
If you look at the source code for silUnit, you will see how to properly create comments in your source code. Note the following:
A brief description of what the routine does.
A description of each parameter and a description of what each parameter represents.
...
Code Block |
---|
/**
* Lists all the files in a given directory tree.
* @param dirName - The path of directory to search
* @param excludes - A list of directories or files to exclude from results
* @return The list of files found in the directory
*/
function directoryFiles(string dirName, string[] excludes) {
// rest of routine here
} |
Conclusion
For a complete explanation of commenting, see this Oracle page on commenting code.
...
Page Properties | ||
---|---|---|
| ||
|