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"?
About Question com.enthuware.ets.scjp.v6.2.3
Moderator: admin
-
- Posts: 7
- Joined: Wed Dec 04, 2013 5:07 pm
- Contact:
-
- Site Admin
- Posts: 10065
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.3
Hi,
The declaration is outside the class. Please see attached image. Are you seeing it inside?
HTH,
Paul.
The declaration is outside the class. Please see attached image. Are you seeing it inside?
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 7
- Joined: Wed Dec 04, 2013 5:07 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.3
Ahh I see...I thought we're inserting the enum statement to the yellow highlighted bar in the code snippet below...haha thanks for the reply Paul
So does the question mean this enum statement will be defined in a separate file called "Seasons.java"? Sorry but I think the problem statement here is a bit too concise...
p.s. why is there a yellow highlighted bar in the code below?
So does the question mean this enum statement will be defined in a separate file called "Seasons.java"? Sorry but I think the problem statement here is a bit too concise...
p.s. why is there a yellow highlighted bar in the code below?
-
- Site Admin
- Posts: 10065
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.3
The problem statement says "In Seasons.java" so that is the file it is going to go in.
Yellow bar has no purpose. Should be removed.
HTH,
Paul.
Yellow bar has no purpose. Should be removed.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 131 guests