diff --git a/src/annotations/elements.md b/src/annotations/elements.md index c7891ba..ddafa23 100644 --- a/src/annotations/elements.md +++ b/src/annotations/elements.md @@ -20,7 +20,7 @@ The method should take no arguments. } ``` -And the return value needs to be one of a few built-in types like `Class`, `String`, `int`, `boolean`, etc.[^fulllist], an `enum`, or an array of one of those. +And the return value needs to be one of a few built-in types like `Class`, `String`, `int`, `boolean`, etc.[^fulllist], an `enum`, another annotation interface, or an array of one of those. ```java,no_run,does_not_compile enum Priority { @@ -28,6 +28,12 @@ enum Priority { LOW } +@interface Deadline { + int year(); + int month(); + int day(); +} + class PersonInCharge {} @interface Todo { @@ -49,7 +55,10 @@ class PersonInCharge {} // Enums ✅ Priority priority(); - // Other Classes ❌ + // Other annotations ✅ + Deadline deadline(); + + // Other classes ❌ PersonInCharge personInCharge(); } ```