版权声明
- 本文原创作者:谷哥的小弟
- 作者博客地址:http://blog.csdn.net/lfdfhl
概述
An annotation is a form of metadata, that can be added to Java source code. Classes, methods, variables, parameters and packages may be annotated. Annotations have no direct effect on the operation of the code they annotate.
Annotation作为元数据可以被添加到Java源代码类、方法、变量、参数、包。虽然源码中添加了注解,但是Annotation不会直接影响程序的执行,无论增加或者删除Annotation,原代码的执行都始终如一。在中文里,常将Annotation翻译为“注解”或者"注释",在本系列教程中我们统一采用"注解"的译法。
有的童鞋对于注解有些恐惧,觉得高深莫测、难以入手;甭着急,我们抛开教科书从你最熟悉的注解来上手学习。
基本注解
在java.lang包中提供了五个基本的Annotation,其中有三个Annotation我们是非常常见的。在此,对这些注解进行详细介绍。
@Override
@Ov