Java Reference
In-Depth Information
{
System.out.println(“Inside Television(int, int)”);
channel = c;
setVolume(v);
}
/**
* Accessor method for the volume field.
* @return the current volume.
*/
public int getVolume()
{
return volume;
}
/**
* Changes the volume as long as the parameter is
* a value between 0 and 10.
* @param v The new volume of the television. This value
* should be between 0 and 10.
*/
public void setVolume(int v)
{
if(v >= 0 && v <= 10)
{
volume = v;
}
}
}
You can run javadoc on one or more classes or on one or more packages. There are
many options for javadoc. To view them, open a command prompt, type in javadoc, and
press Enter.
The following javadoc command is used to generate the HTML pages for the electron-
ics package, with the author and version tags included:
javadoc -author -version -d . electronics
Many pages are generated from this command. The Television documentation page is
shown in Figure 9.7. Notice that the private field volume does not appear because we did
not specify private as one of the javadoc options.
continued
Search WWH ::




Custom Search