6 November 2020

Javadoc

What we are creating with BigFraction is an applications programming interface (API). This sort of class is something another programmer might use to perform calculations in support of their class.

We are going to document our API so another programmer can be concerned about what our code does and not why it works.

There is a special kind of comment for javadoc; it looks like this.


/**
 *   This is a javadoc comment.
 */

You can use HTML features in Javadoc including these tags.

TagPurpose
<code>formats in monospace type
<sup>bounds a superscript
<sub>bounds a subscript
<strong>boldfaces
<em>italicizes

You can use HTML special character entities in Javadoc. Here are some examples.

EntityWhat is shows on the page
&amp;&
&lt;<
&gt;>

@items

@itemUse
@paramCreate one of these for each parameter in your method. In the method detail, this goes under the Parameters: heading
@returnCreate this to describe your method's return value In the method detail, this goes under the Returns: heading
@throwsCreate one of these to describe any exception that your code can throw.

Look in the B and F folders on the left for each block's javadoc.