1.14.1 The Built-In Annotations 内建注解
Java defines seven built-in annotations.
Four are imported from java.lang.annotation: @Retention, @Documented, @Target, and @Inherited.
Three, @Override, @Deprecated, and @SuppressWarnings, are included in java.lang.
Java定义了 7 种内建注解:
其中 4 种从 java.lang.annotation导入:
@Retention
@Documented
@Target
@Inherited
另外3中包含在java.lang中:
@Override
@Deprecated
@SuppressWarnings
1.14.2 Standard Annotations: Override
Override is a marker annotation type that can be applied to a method to indicate to the compiler that the method overrides a method in a superclass. This annotation type guards the programmer against making a mistake when overriding a method. For example, consider this class Parent:
@Override 是标记型注解, 可以应用于方法, 指示编译器该方法覆盖父类的一个方法.
此注解防止编程者在覆盖一个方法时犯错. 例如: 下面的代码编译不通过, 因为父类中没有相同的方法签名.
class Parent { public float calculate (float a, float b) { return a * b; } } //Whenever you want to override a method, declare the Override annotation type before the method: public class Child extends Parent { @Override public int calculate (int a, int b) { return (a + 1) * b; } }
1.14.3 Standard Annotations: Deprecated 不推荐, 藐视
Deprecated is a marker annotation type that can be applied to a method or a type (class/interface) to indicate that the method or type is deprecated.
@Deprecated 是 标记型注解, 可用于方法或类/接口, 指示该方法或类型不被推荐.
If you use or override a deprecated method, you will get a warning at compile time.
如果你使用或覆盖一个不推荐的方法, 在编译时会收到一个警告.
public class DeprecatedTest2 { public static void main(String[] args) { DeprecatedTest test = new DeprecatedTest(); test.serve(); } } class DeprecatedTest { @Deprecated public void serve() { } }
相关推荐
JQUERY1.14 标准,希望学习的人下载
tensorflow1.14 离线安装包
kubernetes-1.14
01-1_C51SPI显示_1.14寸oled例程_1.14寸_1.14寸IPS屏C51驱动例程_ips1.14ascll表.z
autoware 1.14 source
go1.14.zip
snakeyaml-1.14 yml文件读写
tensorflow-r1.14.zip 入门学习 实用资料。
autoware1.14版本安装流程以及所需要的依赖库详细安装流程,支持定位,感知、循迹、绕障等功能测试。包含cuda10.0、qt安装地址。
网吧存储器1.14 www.gamejz.net
jacob1.9 jacob1.12 jacob1.14内附使用说明和三个jar包,由于不同机器适应不同版本,所以打包三个任你选!
jts-1.14.zip
赠送jar包:commons-codec-1.14.jar; 赠送原API文档:commons-codec-1.14-javadoc.jar; 赠送源代码:commons-codec-1.14-sources.jar; 赠送Maven依赖信息文件:commons-codec-1.14.pom; 包含翻译后的API文档:...
jts提供了一系列空间操作的核心算法,此压缩包为jts拓扑套件1.14的jar包
libiconv-1.14.zip
1.14寸IPS屏stm32硬件SPI,DMA驱动,在KEIL5环境下开发。
after: remote:nc -lp 55 local:nc ip 55 > test.c remote:nc -lp 55 _ [can not type in] local:nc ip 55 > test.c _ [can type in,remote out]
libiconv-1.14.tar.gz
TortoiseSVN-1.14.0.28885-x64-svn-1.14.0.msi及对应简体中文安装包LanguagePack_1.14.0.28885-x64-zh_CN.msi