Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #2286

Re: static context puzzle

Path csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail
From Roedy Green <see_website@mindprod.com.invalid>
Newsgroups comp.lang.java.help
Subject Re: static context puzzle
Date Wed, 28 Nov 2012 04:21:11 -0800
Organization Canadian Mind Products
Lines 20
Message-ID <mutbb8l9c392t5ocrm952p59out7hcnka8@4ax.com> (permalink)
References <eksbb851shsvfnllarvd02dt56eenlltt7@4ax.com>
Reply-To Roedy Green <see_website@mindprod.com.invalid>
NNTP-Posting-Host K2Qzzs3EAqXk5RLzfhxcSw.user.speranza.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Complaints-To abuse@aioe.org
X-Notice Filtered by postfilter v. 0.8.2
X-Newsreader Forte Agent 6.00/32.1186
Xref csiph.com comp.lang.java.help:2286

Show key headers only | View raw


On Wed, 28 Nov 2012 03:18:25 -0800, Roedy Green
<see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted
someone who said :

>I have prepared the following SSCCE to demonstrate a puzzle.
>The compiler is complaining about using an instance method in a static
>context. It looks fine to me.  What am I overlooking?

The secret to making it work is to remove the keyword "private"
from 

private int chooseAnAdVariant( final File fileBeingProcessed 

The error message is misleading. Inner classes cannot see the parent's
private methods.  Methods attached to individual enum constants are
inner classes of the enum as a whole under the hood.
-- 
Roedy Green Canadian Mind Products http://mindprod.com
Students who hire or con others to do their homework are as foolish 
as couch potatoes who hire others to go to the gym for them. 

Back to comp.lang.java.help | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

static context puzzle Roedy Green <see_website@mindprod.com.invalid> - 2012-11-28 03:18 -0800
  Re: static context puzzle Roedy Green <see_website@mindprod.com.invalid> - 2012-11-28 04:21 -0800

csiph-web