Home  >  Article  >  Java  >  What is the function of jdk tool javadoc?

What is the function of jdk tool javadoc?

青灯夜游
青灯夜游Original
2020-10-28 10:59:105656browse

The function of the jdk tool javadoc is to "generate Java documentation"; javadoc is a Java documentation generator that extracts comments such as classes, methods, members, etc. from the program source code to form an API help document that matches the source code.

What is the function of jdk tool javadoc?

Related recommendations: "Java Video Tutorial"

The function of the jdk tool javadoc is to "generate Java document".

Javadoc is a technology provided by Sun. It extracts comments such as classes, methods, members, etc. from the program source code to form an API help document that matches the source code. In other words, as long as you use a specific set of tags as comments when writing a program, after the program is written, the program's development documentation can be formed at the same time through Javadoc.

The javadoc command is used to generate your own API documentation. How to use it: Use the command line to enter the javadoc file name.java in the directory where the target file is located.

Common tags

Tags Description JDK 1.1 doclet Standard doclet Tag type
@author author author identification Package, class, interface
@version version number version number Package, class, interface
@param Parameter name description The input parameter name and description information of the method. If you have special requirements for the input parameters, you can this comment. Constructor, method
@return Description The return value of the function Comment Method
@deprecated Expired text identifies the program version Improvement, the current API has expired, just to ensure that compatibility still exists, and to inform developers that they should no longer use this API. Package, class, interface, value range, constructor, method
@throwsException class name Exceptions thrown by constructors or methods.
Constructor, method
@exception Exception class name Same as @throws. Constructor, method
@see Quote View related content, such as Classes, methods, variables, etc. Package, class, interface, value range, constructor, method
@since Description text API is developed and supported after what program and what version. Package, class, interface, value range, constructor, method
{@link package. Class #Member Tag} links to the document corresponding to a specific member.
Package, class, interface, value range, constructor, method
{@value } When annotating a constant, if you want to include its value in the document, reference the value of the constant through this label.
√(JDK1.4) Static value field

In addition, there is @serial , @serialField, @serialData, {@docRoot}, {@inheritDoc}, {@literal}, {@code} {@value arg} are several uncommon tags. Since they are not commonly used, we will not elaborate on them. Interested Readers can view the help documentation.

For more programming-related knowledge, please visit: Introduction to Programming! !

The above is the detailed content of What is the function of jdk tool javadoc?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn