Return to site

JAVA ANNOTATIONS: @Repeatable

There are some situations where you want to apply the same annotation to a declaration or type use. As of the Java SE 8 release, repeating annotations enable you to do this.

· java

Define

  • The annotation type java.lang.annotation.Repeatable is used to indicate that the annotation type whose declaration it (meta-)annotates is repeatable. 
  • The value of @Repeatable indicates the containing annotation type for the repeatable annotation type.

Snippet

Purpose

Set a timer to run a method, doPeriodicCleanup, on the last day of the month and on every Friday at 11:00 p.m.

Use

Thanks to

And thanks to