What is the difference between public and abstract modifier for an elements of annotation in Java.
For example we coul
In java annotation is a special type of interface. So it follows rules of interface and interface methods are by default public
and abstract
. In spite of default consideration, you could still add both public
and abstract
modifier explicitly. But it will be considered as redundant.
Additionally if you declare a variable inside annotation, by default it will be a final
and static
variable.