Home >Java >Javagetting Started >What are the three forms of java annotations?
The three forms of java comments are: 1. Single-line comments, such as [//single-line comments]; 2. Multi-line comments, such as [/*multi-line comments*/]; 3. Document comments, like【/**@author*/】.
JAVA comments have three forms: single-line comments, multi-line comments, and document comments.
(Recommended tutorial: java course)
1. Single-line comment
public class online{ public static void main(String[] args) { //这是一个单行注释 System.out.println("Hello World!"); } }
2. Multi-line comment
public class online{ public static void main(String[] args) { /* 这是一个多行注释 */ System.out.println("Hello World!"); } }
3. Documentation comments
public class online{ public static void main(String[] args) { /** @author a_hasaigei @version 1.0 这是一个文档注释 是用来生成帮助文档的 文档注释,是一种特殊的多行注释 */ System.out.println("Hello World!"); } }
Related recommendations:Getting started with java
The above is the detailed content of What are the three forms of java annotations?. For more information, please follow other related articles on the PHP Chinese website!