|
On Documenting with JavaDocDocumentation is the bridge between the general specifications for your program and the actual code. You should document your code either before or while you write it, not as an afterthought. Using JavaDoc comments (/** */) you should include at least:
When documenting a class or method, describe what it does or what it models. Do NOT describe how it does this--the details of your specific implementation. You only need to use @tags (such as @param, @return, @exception) if the method actually has parameters, returns a value, or throws an exception. You should also use implementation comments (/* */ and //) to comment on tricky or confusing sections of code. JavaDocWhen you're done writing your code, you can type:
at the command line, where [file].java is your source code.
This will create a webpage of your documentation that looks like the Java API Documentation.
The
So, an example javadoc command is:
You can learn more about JavaDoc in general and How to Write JavaDoc Comments directly from java.sun.com. |
~ztomasze Index :
TA Details: ICS211: Coding : JavaDocs http://www2.hawaii.edu/~ztomasze |
Last Edited: 20 Jan 2005 ©2002 by Z. Tomaszewski. |