三、deprecated javadoc 注释的作用 1. 提醒其他开发人员 通过使用deprecated javadoc 注释,我们可以明确地告诉其他开发人员哪些方法或类已经被弃用,不建议再使用。这样做有利于整个团队在开发过程中避免使用过期的代码,从而提高代码的质量和可维护性。 2. 提供替代方案 在deprecated javadoc 注释中,我们可以添加一些说明,...
The javadoc command moves deprecated-text ahead of the main description, placing it in italics and preceding it with a bold warning: Deprecated. This tag is valid in all documentation comments: overview, package, class, interface, constructor, method and field. The first sentence of deprecated ...
@deprecated 指名一个过期的类或成员,表明该类或方法不建议使用 @deprecated description {@docRoot} 指明当前文档根目录的路径 Directory Path @exception 可能抛出异常的说明,一般用于方法注释 @exception exception-name explanation {@inheritDoc} 从直接父类继承的注释 Inherits a comment from the immediate surpercl...
@deprecated标记指示程序元素已经过时。推荐包含@see 或{@link)标记,以告诉程序员有关替代方式的信息。语法如下所示: AI检测代码解析 @deprecated description 1. 其中,description是描述过时元素的消息。可以使用@deprecated 标记文档化域变量、方法、构造函数、类以及接口。
* @deprecated 过期文本,不建议使用,将来可以摒弃,加入此标记后可以看到我们的javaDocTest方法划上了横杠 * @throws @throws IOException(异常类名) * @exception IOException 异常类名 * {@hide} (注明此方法为隐藏方法,其他对象调用不出来,仅供此类和此类的内部类调用,看上面) ...
@deprecated:知名一个过期的类或成员 代码语言:javascript 复制 /** * @deprecated 从v1.1版本开始 */ {@docRoot}:知名当前文档的根目录路径 代码语言:javascript 复制 /** * @docRoot c:java/language */ @exception:标志一个类抛出的异常 代码语言:javascript ...
*@deprecatedAs of JDK 1.1, replaced by * {@link#setBounds(int, int, int, int)} */ 效果展示: 说明:放在该标签内的内容可以保留“原始样子”。 注意: 严格来说,这是html标签,而不属于文档标签,但由于其经常用在描述部分,所以也详细介绍一下。 例子: ...
11.@Deprecated 该标签用于之处一些旧特性已由改进的新特性所取代,建议用户不要再使用这些旧特性,因为在不久的将来它们很可能会被删除。如果使用一个标记为@Deprecated的方法,则会引起编译器发布警告。 源码示例 我们看看JDK8中equals方法的注释是怎样写的: ...
The javadoc command moves deprecated-text ahead of the main description, placing it in italics and preceding it with a bold warning: Deprecated. This tag is valid in all documentation comments: overview, package, class, interface, constructor, method and field. The first sentence of deprecated ...