JavaDoc is written within the Java source code for a particular project and then the javadoc tool is used to extract the JavaDoc-marked-up sections and create the HTML files that comprise the JavaDoc output.
/** * Correct - Returns an Integer representing the mean of the numbers provided as parameters. * * It has the special feature of blah blah blah... * * Incorrect - This method returns an Integer representing the mean of the numbers you provide as parameters. * * This has the special feature of blah blah blah... */
/** * Returns the product of two integers. * * @param int operand one * @param int operand two * @return an int */ public int mul(int a, int b) { return a*b; }
/** * Returns the product of the squares of a and b. * * @see #mul * * @param int operand one * @param int operand two * @return an int */ public int squaredMul(int a, int b) { return mul(mul(a,a),mul(b,b)); }
/** * Represents a "fuzzy" integer, in that the integer is * not exact, but is instead specified as being between a range. * * @author Ashley Mills * @version 1.0b */ public class FuzzyInteger { private int lowerVal, upperVal;
/** * Creates a new <code>FuzzyInteger</code> object based on the * range specified. * * @param lowerVal The lowest value that the integer could be. * @param upperVal The highest value that the integer could be. */ public FuzzyInteger(int lowerVal, int upperVal) { this.lowerVal = lowerVal; this.upperVal = upperVal; }
/** * Doubles the value of the <code>FuzzyInteger</code>. */ public void doubleFuzzy() { lowerVal = lowerVal+lowerVal; upperVal = upperVal+upperVal; } }