What is the result of the following code? (Choose all that apply.)
1: public enum Letter { 2: A(true), B(Boolean.FALSE), C(false), 3: D(false), E(false), F(false) /*from w ww .ja v a 2 s . co m*/ 4: boolean printable; 5: public Letter(boolean printable) { 6: this.printable = printable; 7: } 8: public boolean printable() { 9: return printable; 10: } 11: public void giveWig() { 12: printable = true; 13: } }
B, C.
Enums are required to have a semicolon after the list of values if there is anything else in the enum.
Don't worry; you won't be expected to track down missing semicolons on the whole exam-only on enum questions.
Enums are not allowed to have a public constructor.