Exam 1z0-819 All QuestionsBrowse all questions from this exam
Question 16

Given:

and

Which two are valid usages of the annotation? (Choose two.)

    Correct Answer: D, E

    In the annotation @Meal, the element 'mainCourse' is a required field as it does not have a default value. Therefore, every usage of @Meal must specify a value for 'mainCourse'. Option D is valid as it correctly includes 'mainCourse' in both annotations without duplicating the same value, thereby complying with the repeatable annotation requirement. Option E is also valid as it includes 'mainCourse' as well as 'starter' and 'dessert', satisfying all required elements.

Discussion
d7bb0b2Options: DE

D and E is correct, main curse not has a default value so when use anotation explicit mainCourse be

ue02765Options: DE

A. @Meal is missing a default value for the element 'mainCourse' B. element value must be a constant expression C. @Meal is missing a default value for the element 'mainCourse' D. BUILD SUCCESSFUL E. BUILD SUCCESSFUL

supernhoOptions: DE

Hmm, I think it is DE since mainCourse variable need to be provided and I don't think it would accept null value

Datbt1108

Why A is not correct ?

[Removed]

Because mainCourse is a required element.

Ashan_Ozlov

Everytime we use @Meal we are required to define mainCourse as it is a required element. It doesnt matter that the class has another @Meal annotation having mainCourse you still have to include it whenever you use the annotation @Meal

MSPORDOptions: DE

D and E is correct answer

Ankit1010Options: DE

D and E is correct answer

RP384Options: DE

D and E is the correct answer