About Question com.enthuware.ets.scjp.v6.2.3
Posted: Mon Feb 03, 2014 5:36 am
I don't quite understand this question:
Define an enum named Seasons using the elements given on the bottom:
(in file Seasons.java)
class TestClass {
// Insert code here...
public TestClass() {
}
}
My answer is:
private enum Seasons{SUMMER, WINTER};
and I was marked as wrong, where the correct answer says I must not use "private" as modifier.
I don't understand: the enum Seasons is being defined inside the class TestClass. Why cannot it be "private"?
Define an enum named Seasons using the elements given on the bottom:
(in file Seasons.java)
class TestClass {
// Insert code here...
public TestClass() {
}
}
My answer is:
private enum Seasons{SUMMER, WINTER};
and I was marked as wrong, where the correct answer says I must not use "private" as modifier.
I don't understand: the enum Seasons is being defined inside the class TestClass. Why cannot it be "private"?