1Z0-809 practice question 20 of 25

Given: public enum USCurrency { PENNY (1), NICKLE(5), DIME (10), QUARTER(25); private int value; public USCurrency(int value) { this.value = value; }…

Choose your answer, then check it against the explanation.

Given: public enum USCurrency { PENNY (1), NICKLE(5), DIME (10), QUARTER(25); private int value; public USCurrency(int value) { this.value = value; } public int getValue() {return value;} } public class Coin { public static void main (String[] args) { USCurrency usCoin =new USCurrency.DIME; System.out.println(usCoin.getValue()): } } Which two modifications enable the given code to compile? (Choose two.)
Answer options
Question 20 of 25

Keep practicing

Take the free 1Z0-809 practice test

Ten exam-style questions with answers and explanations, plus the exam facts and study guides.

Start the free practice test

More questions

Other 1Z0-809 practice questions

Scroll to Top