I was looking at the JDK 7 documentation when I noticed an annotation called @Target in the java.lang.annotation . Title of this class
@Documented @Retention(value=RUNTIME) @Target(value=ANNOTATION_TYPE) public @interface Target
Now @Target used as an annotation for itself. How is this possible? @Target used in the title even before its announcement. I tried this with the annotations I wrote and it worked. Can anyone explain what is going on here?
source share