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("你好,世界!");
}
}热门推荐
10 祝女儿简短祝福语大全
11 大学新年祝福语简短创意
12 元旦适合的祝福语简短
13 朋友出远门祝福语简短
14 初六简短的祝福语
15 祝男孩生日祝福语简短
16 同事调离的祝福语简短
17 拜年红包的祝福语简短
18 妈妈生日祝福语简短励志