exam questions

Exam 1z0-819 All Questions

View all questions & answers for the 1z0-819 exam

Exam 1z0-819 topic 1 question 16 discussion

Actual exam question from Oracle's 1z0-819
Question #: 16
Topic #: 1
[All 1z0-819 Questions]

Given:

and

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

  • A. @Meal(mainCourse=”pizza”)
    @Meal(dessert=”pudding”)
    public class Main {
    }
  • B. @Meal(mainCourse=null)
    public class Main {
    }
  • C. @Meal(starter=”snack”, dessert=”ice cream”)
    public class Main {
    }
  • D. @Meal(mainCourse=”pizza”)
    @Meal(mainCourse=”salad”)
    public class Main {
    }
  • E. @Meal(mainCourse=”pizza”, starter=”snack”, dessert=”pudding”) public class Main {
    }
Show Suggested Answer Hide Answer
Suggested Answer: DE 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
ASPushkin
4 months ago
B. FAILED @Meal(mainCourse=null) public class Main { } No Null Value You cannot use a null reference as a value for an element in an annotation.
upvoted 1 times
...
d7bb0b2
1 year ago
Selected Answer: DE
D and E is correct, main curse not has a default value so when use anotation explicit mainCourse be
upvoted 2 times
...
ue02765
1 year, 2 months ago
Selected Answer: 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
upvoted 2 times
...
Datbt1108
1 year, 6 months ago
Why A is not correct ?
upvoted 1 times
Ashan_Ozlov
1 year, 3 months ago
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
upvoted 2 times
...
[Removed]
1 year, 4 months ago
Because mainCourse is a required element.
upvoted 3 times
...
...
MSPORD
1 year, 8 months ago
Selected Answer: DE
D and E is correct answer
upvoted 1 times
...
Ankit1010
1 year, 11 months ago
D and E is correct answer
upvoted 1 times
...
RP384
1 year, 11 months ago
Selected Answer: DE
D and E is the correct answer
upvoted 1 times
...
supernho
1 year, 12 months ago
Hmm, I think it is DE since mainCourse variable need to be provided and I don't think it would accept null value
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago