Java Reference
In-Depth Information
* Holds the real part of this complex number.
* @see #y
*/
protected double x ;
/**
* Holds the imaginary part of this complex number.
* @see #x
*/
protected double y ;
/**
* Creates a new Complex object that represents the complex number
* x+yi. @param x The real part of the complex number.
* @param y The imaginary part of the complex number.
*/
public Complex ( double x , double y ) {
this . x = x ;
this . y = y ;
}
/**
* Adds two Complex objects and produces a third object that
* represents their sum.
* @param c1 A Complex object
* @param c2 Another Complex object
* @return A new Complex object that represents the sum of
* <code>c1</code> and <code>c2</code>.
* @exception java.lang.NullPointerException
* If either argument is <code>null</code>.
*/
public static Complex add ( Complex c1 , Complex c2 ) {
return new Complex ( c1 . x + c2 . x , c1 . y + c2 . y );
}
}
Structure of a Doc Comment
The body of a doc comment should begin with a one-sentence summary of the type
or member being documented. This sentence may be displayed by itself as summary
documentation, so it should be written to stand on its own. The initial sentence may
be followed by any number of other sentences and paragraphs that describe the
class, interface, method, or field in full detail.
s
After the descriptive paragraphs, a doc comment can contain any number of other
paragraphs, each of which begins with a special doc-comment tag, such as @author ,
@param , or @returns . These tagged paragraphs provide specific information about
the class, interface, method, or field that the javadoc program displays in a standard
way. The full set of doc-comment tags is listed in the next section.
 
Search WWH ::




Custom Search