Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/annotations/elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,20 @@ 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 {
HIGH,
LOW
}

@interface Deadline {
int year();
int month();
int day();
}

class PersonInCharge {}

@interface Todo {
Expand All @@ -49,7 +55,10 @@ class PersonInCharge {}
// Enums ✅
Priority priority();

// Other Classes ❌
// Other annotations ✅
Deadline deadline();

// Other classes ❌
PersonInCharge personInCharge();
}
```
Expand Down