Java SE 11 Developer (1Z0-819) — Question 59

Which declaration of an annotation type is legal?

Answer options

Correct answer: A

Explanation

Option A is correct because it adheres to the rules of annotation declaration, allowing for a default value for the 'name' method while 'date' is required. Option B is incorrect as annotation types cannot extend other classes or interfaces. Option C is invalid because 'null' cannot be used as a default value. Options D and E are both wrong due to 'date' not being a method in D and the incorrect syntax in E.