exam questions

Exam 1z0-819 All Questions

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

Exam 1z0-819 topic 1 question 57 discussion

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

Given:



What is the correct definition of the JsonField annotation that makes the Point class compile?

  • A.
  • B.
  • C.
  • D.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

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
6 months ago
Selected Answer: D
A,B failed Has to be @Target(ElementType.FIELD) C Failed The value for name is mandatory if not has a default value
upvoted 1 times
...
d7bb0b2
1 year, 1 month ago
D is correct, cause name is default value, is not required when use an anotaccion, and TYPE is FIELD not method. C is incorrect cause name is mandatory if not has a default value
upvoted 1 times
...
RoxyFoxy
1 year, 3 months ago
Selected Answer: D
String name() is not mandatory for all instance variables, because it has a default value so C is not correct. type() is specified for all variables because has no default value.
upvoted 1 times
RoxyFoxy
1 year, 3 months ago
ElementType.FIELD - applies to instance and static variables, and enum values. In this example _name, x and y are all instance variables, and all have type=..., so type() mandatory.
upvoted 1 times
...
...
Omnisumem
1 year, 5 months ago
Selected Answer: C
Tested: C!
upvoted 1 times
Ashan_Ozlov
1 year, 4 months ago
But C doesn't compile, I tested and D is correct
upvoted 2 times
...
...
[Removed]
1 year, 5 months ago
Selected Answer: D
C is incorrect as name needs a default value. D is correct because of the ElementType.FIELD being used correctly. B is incorrect because ElementType.TYPE can only be used for: Class, interface (including annotation type), or enum declaration
upvoted 1 times
...
Stavok
1 year, 6 months ago
Selected Answer: C
C is correct This definition includes the required elements name and type, with name having a default value of an empty string. The Type enum is also defined with the required values INT, STRING, and BOOLEAN. The annotation does not need to specify a target or retention policy to compile.
upvoted 1 times
...
tmuralimanohar
1 year, 7 months ago
Answer: D
upvoted 1 times
...
Nayoumi
1 year, 7 months ago
Selected Answer: D
D is the correct answer
upvoted 1 times
...
Ankit1010
1 year, 12 months ago
Correct answer is D. Because of, @Target(ElementType.FIELD) String name() default "";
upvoted 1 times
...
Obalt
2 years ago
The correct answer is D
upvoted 1 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