javadoc
能出现在类或者接口文档中:
- @see
- @deprecated
- @author
- @version
- 等
可以出现在方法或者构造器文档注释中
- @see
- @deprecated
- @param
- @@return
- @throws
- @exception
- 等
可以出现在Field文档注释中的有
/**
* javadoc 注释的使用
* @author : 稷下长安™ 指定Java程序的作者
* @version : 指定Java源文件的版本
* @deprecated : 不推荐使用的方法
* @param : 方法的参数说明信息
* @return : 方法的返回值说明信息
* @see : ”参见“,用于指定交叉和参考的内容
* @deprecated : 抛出异常的类型
* @throws : 抛出的异常,和exception同义
*/
public class Annotation {
/**
* 一个得到打招呼字符串的方法
* @param name 该参数指定向谁打招呼
* @return 返回打招呼的字符串
*/
public static String hello(String name){
return name + " ,你好!";
}
public static void main(String[] args) {
String st = hello("张三");
System.out.println(st);
}
}