Home Java javaTutorial Introduction to Java Basics Essay (9) JavaSE Edition - Documentation Comments

Introduction to Java Basics Essay (9) JavaSE Edition - Documentation Comments

Dec 22, 2016 pm 01:15 PM

In the previous section, we wrote about the definition and use of some static variables and static methods, as well as the differences between them and non-static. In this section, we will add:

If all methods in a class are static and have no member variables, you need to Restrict the corresponding class. This class cannot create objects. The specific operations are as follows:

PRivate ArrayTool(){}

//The methods in this class are all static, so this class does not need to create objects. In order to prevent others from creating objects of this class, you can make the constructor of this class private.

1. Documentation comments

Use the javadoc tool in the java fake machine to generate documentation comments, and use the documentation comments in the code to generate them.

Note:

1. Each compilation unit (class file) can only have one public class
2. The name of the public class (including upper and lower case) must have the same name as its class file.
3. Public class does not need to exist in a class file (*.java).

Use javadoc tag:

javadoc tag consists of "@" followed by the tag type and special annotation reference
javadoc tags are as follows:
@author indicates the author who developed the module of this class
@version indicates the class The version of the module
@see Reference steering, that is, related topics
@param Description of a certain parameter in the method
@return Description of the return value of the method
@exception Description of exceptions that may be thrown by the method

The above is the basics of Java Introductory Essay (9) JavaSE version - the content of documentation comments. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Statement of this Website
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to annotate PHP functions with documentation comments? How to annotate PHP functions with documentation comments? Apr 11, 2024 pm 04:48 PM

PHP documentation comments are used to annotate functions and contain the following required fields: description, parameters (@param), and return value (@return). Optional fields include: exceptions (@throws), introduction version (@since), and usage examples (@example). Use the PHPDocumentor tool to generate HTML documentation to view annotated functions.

Code comments in PHP Code comments in PHP May 23, 2023 am 08:27 AM

Code comments are text reminders that programmers add when writing code to make it easier for themselves and other programmers to read and understand the code. In PHP, code comments are indispensable. This article will introduce in detail the types, specifications and uses of code comments in PHP. 1. Code comment types in PHP In PHP, there are three types of comments: single-line comments, multi-line comments and documentation comments. Single-line comments A single-line comment starts with a double slash "//" and ends at the end of the line. For example: //This is a single line comment multi-line comment multi-line comment ends with "

The complementary relationship between documentation comments and naming conventions in C++ function naming The complementary relationship between documentation comments and naming conventions in C++ function naming May 03, 2024 am 09:00 AM

Function naming conventions and documentation comments in C++ complement each other and improve code readability. Naming conventions provide clear and consistent function names, while documentation comments supplement details such as their purpose, parameters, return values, and preconditions, ensuring that the code is easy to understand, maintain, and extend.

Java beginners: How to define the entry stage? Java beginners: How to define the entry stage? Feb 18, 2024 pm 06:29 PM

Getting Started with Java: At What Step in Learning Is Beginner? As a programming language widely used in the field of software development, Java is easy to learn, cross-platform, and highly secure, so it is very popular among programmers. Many beginners hope to get started with Java as soon as possible and start their programming journey. So, how do we judge that we have gotten started with Java and what step have we learned? First of all, we need to clarify a concept: getting started does not mean being proficient. Getting started only completes the preliminary understanding and mastery of the Java language. You can

Important prerequisites for learning Java technology: understanding core concepts and application tools Important prerequisites for learning Java technology: understanding core concepts and application tools Jan 13, 2024 pm 03:02 PM

Essential knowledge for learning Java technology: master key concepts and development tools, and require specific code examples. Java is a computer programming language widely used in the field of software development. Its power lies in its cross-platform features and rich development tool support, making Java one of the most popular programming languages ​​today. If you want to learn Java technology, mastering some key concepts and development tools is essential. This article will introduce you to some essential Java knowledge and provide some specific code examples to help you better

PHP Comment Specification: How to use documentation comments to write API documentation PHP Comment Specification: How to use documentation comments to write API documentation Jul 30, 2023 pm 07:00 PM

PHP Comment Specification: How to use documentation comments to write API documentation Introduction: When developing PHP applications, writing complete API documentation is very important for the development team and other developers. Good documentation improves code readability and maintainability, and promotes teamwork and information sharing. This article will introduce how to use documentation comments to write PHP API documentation, and provide some sample code to help readers understand how to write comments in a standardized way. Comment specification In PHP, we use comments to explain and describe the code. generally

Sharing of efficient learning methods for JAVA core knowledge Sharing of efficient learning methods for JAVA core knowledge Nov 08, 2023 pm 06:44 PM

JAVA is an object-oriented programming language that is widely used in the field of software development. Mastering and proficiently using the core knowledge of JAVA is crucial for programmers. It can improve development efficiency and make code more reliable and easier to maintain. This article will share several methods for efficiently learning core JAVA knowledge and provide specific code examples. 1. Basic steps for learning core JAVA knowledge. To learn a new programming language, you first need to master its basic syntax and features. For JAVA, you can read relevant tutorials or books

How to clarify the requirements and recommendations of the latest PHP code specifications in project documents and documentation comments? How to clarify the requirements and recommendations of the latest PHP code specifications in project documents and documentation comments? Sep 05, 2023 pm 02:16 PM

How to clarify the requirements and recommendations of the latest PHP code specifications in project documents and documentation comments? Introduction: During the development of PHP projects, it is very important to follow unified code specifications. Good code specifications can improve the readability and maintainability of code, reduce coding errors, and improve team collaboration efficiency. In order to ensure project code quality, the development team needs to clarify the latest PHP code specification requirements and recommendations. In this article, we describe how to make these requirements and recommendations explicit in project documentation and documentation comments, illustrated with code examples

See all articles