Exam 1z0-809 All QuestionsBrowse all questions from this exam
Question 98

Given the code fragment:

Which is the valid definition of the Course enum?

A.

B.

C.

D.

    Correct Answer:

Discussion
jduarte

Answer D. the constructor cannot be public. enum cannot be final class. The method cannot be abstract if the variable is not abstract.

AVB22

and static variable cannot be initialized in an enum constructor

WilsonKKerll

No Any Option.!!!! Answer : enum Course { JAVA(100), J2ME(150); private int cost; private Course(int cost) { this.cost = cost; } int getCost() { return cost; } }

asdfjhfgjuaDCV

D is the correct answer

steefaand

D is answer.

karta

Answer is D