Có 2 kiểu Java Annotation:
-
Các Annotation được tích hợp sẵn trong Java: Override, Overload...
-
Annotation tùy chỉnh - do người dùng định nghĩa.
@Override, @SuppressWarnings, @Deprecated
@Target, @Retention, @Inherited, @Documented
Giải thích ý nghĩa của các Annotation phía sau:
Được người dùng định nghĩa rất dễ dàng để tạo và sử dụng ?? -> Chưa rõ phần này. Phần tử @interface được sử dung để khai báo một Annotation.
-
Marker Annotation
-
Single-Value Annotation
-
Multi-Value Annotation
@Target
@Retention
@Inherited
@Documented