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

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
TwistedLizard
Posts: 57
Joined: Sat Mar 01, 2014 1:48 pm
Contact:

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

Post by TwistedLizard »

I think the wording of the commentary for this question is inaccurate.

Code: Select all

class Outsider{
	public class Insider{ }
}
public class TestClass{
	public static void main(String[] args){
		Outsider os = new Outsider();
		// 1 insert line here
	}
}
The commentary for the 4th option

Code: Select all

Insider in = Outsider.new Insider();
says
Outsider.new Insider() is wrong as well because Insider is not static;
but that's not the reason this option is wrong. If Insider were static, the syntax would be

Code: Select all

Outsider.Insider in = new Outsider.Insider();

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

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

Post by admin »

Actually, it is in connection with option 3, which is, "Outsider.Insider in = os.new Insider();" and the comment for this option "Since Insider is not a static class, it must have an associated outer class instance."

Option 4 replaces the variable os with class name Outsider, so the comment is talking about why replacing os with Outsider will not help.

TwistedLizard
Posts: 57
Joined: Sat Mar 01, 2014 1:48 pm
Contact:

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

Post by TwistedLizard »

No big deal, but to me, the flow of that particular explanation seems hard to follow. Cheers.

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

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

Post by admin »

OK, will improve.

thank you for your feedback!

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests