exam questions

Exam 1z0-809 All Questions

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

Exam 1z0-809 topic 1 question 98 discussion

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

Given the code fragment:

Which is the valid definition of the Course enum?
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
6c84cb9
4 months ago
Answer: D, because: In the case of an enum in Java, the constructor is always private by default, even if you don't explicitly use the private keyword. This means that you can't create new instances of an enum outside of its definition, only inside the enum itself.
upvoted 1 times
...
asdfjhfgjuaDCV
10 months, 2 weeks ago
D is the correct answer
upvoted 1 times
...
steefaand
11 months, 2 weeks ago
D is answer.
upvoted 1 times
...
karta
2 years, 5 months ago
Answer is D
upvoted 1 times
...
WilsonKKerll
2 years, 10 months ago
No Any Option.!!!! Answer : enum Course { JAVA(100), J2ME(150); private int cost; private Course(int cost) { this.cost = cost; } int getCost() { return cost; } }
upvoted 2 times
...
jduarte
3 years, 9 months ago
Answer D. the constructor cannot be public. enum cannot be final class. The method cannot be abstract if the variable is not abstract.
upvoted 3 times
AVB22
3 years, 2 months ago
and static variable cannot be initialized in an enum constructor
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