About Question com.enthuware.ets.scjp.v6.2.739 :
Moderator: admin
About Question com.enthuware.ets.scjp.v6.2.739 :
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() { ... }.
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() { ... }.
-
- Site Admin
- Posts: 10386
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.739 :
Hello,
Yes, it is correct. It is not a complete declaration but only a part of the declaration.
HTH,
Paul.
Yes, it is correct. It is not a complete declaration but only a part of the declaration.
HTH,
Paul.
-
- Posts: 50
- Joined: Sun Nov 10, 2013 4:39 am
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.739 :
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.
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.
-
- Site Admin
- Posts: 10386
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.739 :
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.
HTH,
Paul.
Re: About Question com.enthuware.ets.scjp.v6.2.739 :
Why is
only a part of declaration, not full declaration?
Code: Select all
private class C {}
-
- Site Admin
- Posts: 10386
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.739 :
Yes, it is valid full inner class declaration. 100% part!
-
- Posts: 9
- Joined: Mon Apr 15, 2024 11:36 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.739 :
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
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
-
- Site Admin
- Posts: 10386
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.739 :
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.
Who is online
Users browsing this forum: Bing [Bot] and 10 guests