All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: About Question com.enthuware.ets.scjp.v6.2.203 :
PostPosted: Sun Apr 16, 2017 3:42 pm 
Offline

Joined: Sat Mar 01, 2014 1:48 pm
Posts: 29
I think the answer to this question is wrong :)

'Which variables of the encapsulating class can an inner class access, if the inner class is defined in an instance method of the encapsulating class?'

Of the suggested answers, 1,2,3 are clear enough.

[Option 5:All final automatic variables] would I think, only be admissible if there were ambiguity in the question, which there isn't.

Option 5 is untrue because:
(1) Automatic variables don't belong to the enclosing class, they can only appear in its methods.
(2) Even if we ignore (1), it's only automatic variables defined in the method containing the inner class that are visible, not automatic variables in any other method.

I'd be interested to hear your take on this.


Top
 Profile Send private message  
 
 Post subject: Re: About Question com.enthuware.ets.scjp.v6.2.203 :
PostPosted: Mon Apr 17, 2017 9:23 am 
Offline
Site Admin

Joined: Fri Sep 10, 2010 9:26 pm
Posts: 6519
You are right. Although this interpretation is not what the question is getting at but it is possible to interpret it that way.
Updated.

thank you for your feedback!
Paul.


Top
 Profile Send private message  
 
 Post subject: Re: About Question com.enthuware.ets.scjp.v6.2.203 :
PostPosted: Mon Apr 17, 2017 2:40 pm 
Offline

Joined: Sat Mar 01, 2014 1:48 pm
Posts: 29
Thanks for that clarification Paul.

I appreciate the normally scrupulous style of the Enthuware questions.

Regards
Richard


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Template made by DEVPPL/ThatBigForum