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

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
chang_surrey
Posts: 7
Joined: Wed Dec 04, 2013 5:07 pm
Contact:

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

Post 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"?

admin
Site Admin
Posts: 10065
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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 2506 times
If you like our products and services, please help us by posting your review here.

chang_surrey
Posts: 7
Joined: Wed Dec 04, 2013 5:07 pm
Contact:

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

Post 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?

admin
Site Admin
Posts: 10065
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 131 guests