Marker annotations are special annotations, declared no members.
In the below example we will identify marker annotation using
isAnnotationPresent() SOURCE:
MarkerAnnotationDemo .java OUTPUT:
Is marker interface exists
You can also read
- Introduction to Java Annotations
- How to write custom annotation
- Writing custom Annotation with RentionPolicy
- How read annotation at runtime using Java Reflection
- How to list out annotations used in a class using Java Reflection
- How to create custom annotation with default values
- How to create Marker Annotation using java
0 comments :
Post a Comment