Java注释
Java语言支持三种类型的注释-
编译器将忽略从/*到*/的所有内容。
编译器将忽略////到行尾的所有内容。
这是一个文档注释,通常称为doccomment。在准备自动生成的文档时,JDKJavadoc工具使用文档注释。
以下是一个简单示例,其中/*...*/中的行是Java多行注释。类似地,//继续的行是Java单行注释。
示例
/**
* The HelloWorld program implements an application that
* simply displays "你好,世界!" to the standard output.
*
* @author Zara Ali
* @version 1.0
* @since 2014-03-31
*/
public class HelloWorld {
//标准主要方法
public static void main(String[] args) {
/* Prints Hello, World! on standard output. */
System.out.println("你好,世界!");
}
}您可以在描述部分中包含必需的HTML标记。例如,以下示例将<h1>....</h1>用于标题,并将<p>用于创建段落中断-
示例
/**
* <h1>Hello, World!</h1>
* The HelloWorld program implements an application that
* simply displays "你好,世界!" to the standard output.
* <p>
* Giving proper comments in your program makes it more
* user friendly and it is assumed as a high quality code.
*
*
* @author Zara Ali
* @version 1.0
* @since 2014-03-31
*/
public class HelloWorld {
//标准主要方法
public static void main(String[] args) {
/* Prints Hello, World! on standard output.*/
System.out.println("你好,世界!");
}
}热门推荐
1 训练狗狗憋尿
2 狗狗追踪训练
3 狗狗训练要多少钱
5 深圳狗狗训练
6 训练狗狗唤回
7 狗狗叫怎么训练
8 狗狗训练班
10 狗狗社会化训练
11 狗狗叫回训练
12 广州狗狗训练学校
13 狗狗训练躺下
14 狗狗随行训练
15 训练狗狗巡回
16 狗狗要怎么训练
17 狗狗喂食训练
18 训练狗狗躺下