Type a custom annotation with two elements and a default
Type a custom annotation with two elements and a default
Answer
public @interface Review { String author(); int priority() default 1; }
author() is required (no default). priority() is optional and defaults to 1. Use @Review(author = "alice") or @Review(author = "alice", priority = 3).