/** This class is a demo of javadoc.
* This comment will go at the top with the name of the class.
*
To javadoc this file while creating a tech spec, try
* javadoc -private UsingJavadoc.java
*/
public class UsingJavadoc {
/** the integer x.
this top part will go in the field summary.
* This part on the next line goes into the field details */
private int x;
/** the integer y */
public int y;
/** the default constructor.
*
The top line of this comment will go in the constructor summary
*
All the lines go into the constructor detail.
*/
public UsingJavadoc() { }
/**
* purpose: this is an example of what Javadoc can do
*
These lines go into the method summary. As soon as i use a period
* (see the beginning of this sentence), it stops.
*
* All lines go into the method detail. Note that despite the blank
* line above this section, we dont get a line break. you can use an
* html tag to make line breaks. (Notice the line
break in the
* Javadoc)
*
* @param p this is my parameter...
* @return this method returns an integer which is the input plus one
*
* code or pseudo code goes in tags like these
* Notice that the previous words appear in a different font.
*
*
other html tags such as
for paragraph work too. Notice that * a new paragraph started in the Javadoc. If you know other html tags, * you can experiment with them. * *
Don't use too many html tags tho since it makes the Java harder * to read * *
precondition: not a whole lot * *
postcondition: something i'm sure * *
There are html tags which render lines as-is. These may also * help with pseudo code. *
* this is being shown exactly as typed
* even the line breaks and crazy spacing
notice that if i leave the star off the begining of the line,
the start is from the page edge, not the star line
*
*/
public int someMethod(int p) {
return p + 1;
}
/**
* Other commands you can give javadoc.
*
* javadoc -d a_directory
* javadoc -help
*