Home > Java > Javagetting Started > body text

What are the three forms of java annotations?

王林
Release: 2020-10-20 10:53:50
Original
33276 people have browsed it

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*/】.

What are the three forms of java annotations?

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!");
	}
}
Copy after login

2. Multi-line comment

public class  online{
	public static void main(String[] args) {
		/*
		这是一个多行注释
		*/
		System.out.println("Hello World!");
	}
}
Copy after login

3. Documentation comments

public class  online{
	public static void main(String[] args) {
		/**
		@author a_hasaigei
		@version 1.0
		这是一个文档注释
		是用来生成帮助文档的
		文档注释,是一种特殊的多行注释
		*/
		System.out.println("Hello World!");
	}
}
Copy after login

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!

Related labels:
source: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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!