About Question com.enthuware.ets.scjp.v6.2.739 :

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

Moderator: admin

Post Reply
ETS User

About Question com.enthuware.ets.scjp.v6.2.739 :

Post by ETS User »

I don't get the answer, private class C.

Does it answere the question,
Which of the following options can be a part of a correct inner class declaration or a combined declaration and instance initialization?

Answere nuber two I understand, new SimpleInterface() { ... }.

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

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

Post by admin »

Hello,
Yes, it is correct. It is not a complete declaration but only a part of the declaration.

HTH,
Paul.

devlam
Posts: 50
Joined: Sun Nov 10, 2013 4:39 am
Contact:

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

Post by devlam »

In my opinion answer 3 should also be a right answer. Allthough the name suggests it is an interface you can't say it is because there is no interface declaration.
So if you must select 2 options, the right answers are 1,2 and 1,3 and 2,3. Or the question must be to select 3 options offcourse.
The fact that ComplexInterFace suggest an interface can than be explained in the explanation that allthough the name it should be a class.

Or extend the question with information that SimpleInterface and ComplexInterface are really interfaces.

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

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

Post by admin »

If you select option 3 as correct, some will come up and say that the name suggests it is an interface and so it should be wrong. That is the point we are trying to make in this question that sometimes you may get a question that is ambiguous. Giving this information in the question, will render the question useless.

HTH,
Paul.

Deleted User 6318

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

Post by Deleted User 6318 »

Why is

Code: Select all

private class C {}
only a part of declaration, not full declaration?

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

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

Post by admin »

Yes, it is valid full inner class declaration. 100% part!

dalvir
Posts: 9
Joined: Mon Apr 15, 2024 11:36 pm
Contact:

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

Post by dalvir »

Hi

for this question, I believe the following declaration should end in a semicolon to make it a valid anonymous class declaration.


new SimpleInterface() {   //valid code }

What are your thoughts on it?

Thanks

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

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

Post by admin »

Yes, ideally it should but none of the options have a semi-colon and the problem statement does say "Which of the following options can be a part of a correct...". So you may ignore that issue.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 10 guests