Page 1 of 1

About Question com.enthuware.ets.scjp.v6.2.3

Posted: Mon Feb 03, 2014 5:36 am
by chang_surrey
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"?

Re: About Question com.enthuware.ets.scjp.v6.2.3

Posted: Mon Feb 03, 2014 6:17 am
by admin
Hi,
The declaration is outside the class. Please see attached image. Are you seeing it inside?

HTH,
Paul.
test.png
test.png (10.63 KiB) Viewed 2975 times

Re: About Question com.enthuware.ets.scjp.v6.2.3

Posted: Mon Feb 03, 2014 7:17 am
by chang_surrey
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 :D

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?

Re: About Question com.enthuware.ets.scjp.v6.2.3

Posted: Mon Feb 03, 2014 8:11 am
by admin
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.