Usage of Javadoc comments

    1. Java documentation // comment a line /*…… */ Comment several lines /**…… */ Comment several lines and write them to a Javadoc document. Typically, such comments are written as follows: /** *……… *… Java This command compiles a Java source file named “source.java” and stores the generated document in the directory specified in “Document directory”. The index.html in the generated document is the first page of the document. The -author and -version options can be omitted.

      1. Formatting documents and document comments The resulting document is in HTML format, and these HTML identifiers are not added by Javadoc, but are added when we write the comments. For example, when you need a line break, instead of typing a carriage return, you write

      . If you want to segment, you write

      before the segment. Instead of copying the body of the document’s comments directly to the output file (the HTML file of the document), each line is read, and the leading asterisks and Spaces before the asterisks are deleted and entered into the document’s.

      ***** This is second line.

      This is third line. */ 2

      show

      * @param b true Public void show(Boolean b) {frame.show(b); false: hide * @return no return value */ public void show(Boolean b) {frame.show(b); } The first part is a brief description. In documentation, there is a list of properties and methods, followed by a detailed description at the beginning of a document comment, the first dot (.). Before (including dot). In other words, document comments are separated by the first dot, followed by the brief, followed by parts 2 and 3. The second part is the detailed explanation part. This section describes attributes or methods in detail. There are no special formatting requirements. It can contain several dots. *

      show method

      * show method

      Keep that in mind that the third section is the special instructions section. This section includes version description, parameter description, return value description, etc. * @param b true to display, false to hide * @return does not return a value \

      The Javadoc tag consists of the “@” tag type followed by a dedicated comment reference. There are some Javadoc tags: @author indicates the author who developed the module. @version indicates the version of the module. @param description of a parameter in a method @return description of a value returned by a method @exception Description of exceptions that may be thrown by the other method @author author name @version Version Use commas (,) to separate authors from each other in the resulting document. @version can also be used multiple times, with only the first valid use of @param, @return, and @exception indicating that all three tags are for methods only. @param describes method arguments, @return describes method return values, and @exception describes exceptions that a method may throw. Their syntax is as follows: @param Parameter Name Parameter Description @return Return value @exception Exception class name Description 4 Javadoc [options] [Packagenames] [Sourcefiles] -public Displays only public classes and members. -protected Displays protected/public classes and members (default). -package Displays package/protected/public classes and members -d

      Target directory of the output file -version contains @version segment -author contains @author segment -splitIndex Divides the index into a file for each letter -windowTitle

      The browser window title of the document Javadoc can compile the document with a list of packages or a list of source program files. For example, there are two packages in the CLASSPATH and the following classes: Fancy.editor fancy.test fancy.editor.ECommand fancy.editor.EDocument Fancy.editor. javadoc fancy\Test.java fancy\Editor.java fancy\editor\ECommand.java fancy\editor\EDocument.java Fancy \editor\ eview.java can also be used to give the package name as a compilation parameter, as in: Javadoc fancy Fancy. Editor: javadoc fancy Fancy. Editor: javadoc Fancy Fancy.