从零开始学java(3)--java的注释
Java有三种注释:
1.// 注释一行
2. /* ... ... */ 注释一段
3. /** ... ...*/ 文档型注释
第一种注释,一般单独放在一行,对下面一行代码做出简单的说明。
//变量apple
int apple =0;
第二中注释对若干行进行注释,可分为多行。如:
/* 下面是歌词
* her mind is tiffany-twisted,
* she got the mercedes Benz.
* she got a lot of pretty,
* that she calls friends.
* how they dance in the courtyard,
* sweet summer sweat.
* some dance to remember!
* some dance to forget!
*/
第三种跟第二种写法上差不多,但是,第三种编译器是可以看懂的,当使用javadoc这样的命令时会用到,用来生成API时用的。
浙公网安备 33010602011771号