Page 1 of 1

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

Posted: Mon Apr 18, 2011 7:43 am
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() { ... }.

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

Posted: Mon Apr 18, 2011 7:25 pm
by admin
Hello,
Yes, it is correct. It is not a complete declaration but only a part of the declaration.

HTH,
Paul.

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

Posted: Mon Dec 02, 2013 2:15 pm
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.

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

Posted: Mon Dec 02, 2013 8:23 pm
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.

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

Posted: Wed Oct 28, 2020 9:15 am
by Deleted User 6318
Why is

Code: Select all

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

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

Posted: Wed Oct 28, 2020 9:53 am
by admin
Yes, it is valid full inner class declaration. 100% part!

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

Posted: Sat Jul 06, 2024 12:20 am
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

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

Posted: Sat Jul 06, 2024 9:09 am
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.