注释
Java中的注释有三种:
- 单行注释
- 多行注释
- 文档注释
/**
* @author Zhang
* @version 1.0
* @since 1.8
*/
public class Demo03 {
public static void main(String[] args) {
//单行注释 : 只能注释一行文字 //
//输出hello,world
System.out.println("Hello,World!");
//多行注释 :可以注释一段文字 /* 注释 */
/*
输出hello,world
输出hello,world
输出hello,world
输出hello,world
*/
}
//JavaDoc:文档注释 /** */
/**
*
* @param a
* @param b
* @return
*/
public int add(int a, int b){
return a+b;
}
}
## 注释不会被执行,是给我们写代码的人看的