I can't figure out a use case for being able to annotate interfaces in Java.
Maybe someone could give me an example?
See Question&Answers more detail:osI can't figure out a use case for being able to annotate interfaces in Java.
Maybe someone could give me an example?
See Question&Answers more detail:osI've used it in Spring to annotate interfaces where the annotation should apply to all subclasses. For example, say you have a Service interface and you might have multiple implementations of the interface but you want a security annotation to apply regardless of the annotation. In that case, it makes the most sense to annotate the interface.