Page 809 - Introduction to Programming with Java: A Problem Solving Approach
P. 809

                Figure A6.5
Salaried class from Figure 13.11 modified to enable javadoc
exactly the same as that defined in Figure 13.11. But this version enables several javadoc features. Notice how the general class description has been moved from the prologue into a separate javadoc comment block immediately above the class heading. In the javadoc comment block above the constructor there are two tagged parameter descriptions. In the javadoc comment block above the method there is a tagged return value description.
Suppose that the current directory contains source code for the Employee class copied from Figure 13.10, and it also contains the source code for the Salaried_jd class shown in A6.5. Then sup- pose we open a Command Prompt window and enter the following command:
javadoc -d docs Employee.java Salaried_jd.java
Appendix 6 Javadoc 775
 /*************************************************************
* Salaried_jd.java
* Dean & Dean
*************************************************************/
moved from prologue
    /**
This class implements a salaried employee.
It has same functionality as the Salaried class in Chapter 13.
*/
public class Salaried_jd extends Employee
{
private double salary;
//**********************************************************
/**
person's name ⎫⎬ @param salary annual salary in dollars ⎭
*/
public Salaried_jd(String name, double salary)
  @param name
tagged comments
  {
}
super(name);Apago PDF Enhancer this.salary = salary;
// end constructor
//**********************************************************
/** @return
half month's pay in dollars */
tagged comment
    }
// end class Salaried_jd
public double getPay()
{
return this.salary / 24;
} // end getPay




























































   807   808   809   810   811