Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: please help understanding syntax Date: Sat, 07 Jan 2012 20:58:31 -0800 Organization: albasani.net Lines: 42 Message-ID: References: <7e21b19b-356f-4a0b-ae08-687fc79e1afa@dp8g2000vbb.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net aEWiv3VKWm+Q3vaKXw7ijEo2J6lqeUh8WMG9n53S4nhv0iHikZPO4ZRUPhxHF5gRgjik+LFvg66CENNXHcm1yW9VpScYMvS18njaT81rd7dL5hVdSSmBgPyGnjTy71Zf NNTP-Posting-Date: Sun, 8 Jan 2012 04:58:29 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="cF6dU82jqvci5/I0O9RzFJr4hsUQI3WKlBCH+f0EV6hk+m2uixCK1ZYbCcdEQBmFnw+eKGJuLzMlM+Pe8Y3TmXKgUkww+FQhXHZhAEapN4n2+LqZG5B0gpF15qwU2lL7"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111109 Thunderbird/3.1.16 In-Reply-To: Cancel-Lock: sha1:DL4XMzXDGVY3tmHDfjQ32Qdh8fQ= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:11102 Steven Simpson wrote: > John Goche wrote: >> public void checkAccount(final Account account) >> { >> Auth.background() >> { >> @Override >> public void run() >> { >> Auth.checkAccount(account, this, new CustomCallback() >> { >> @Override >> public void handle(int resultCode) >> { >> // ... >> } >> }); >> } >> }); >> } >> >> Can someone please explain the syntax Auth.background() { ... } . > > It's a syntax error, surely? Try sticking it in a syntax-aware editor with a > 'class X { }' around it. When I add the closing brace in emacs, I'm told > "Mismatched parentheses". > > Perhaps it's supposed to be 'new Auth.background()', though that's an > unconventional name for a class. > > Perhaps it's supposed to be 'new Auth.background(new Runnable() { ...'. > > ... Whatever it's supposed to be, the code at that site is not compilable, nor does the author even provide complete classes. It is evidence that mere presence on the Web does not make for good information. -- Lew Honi soit qui mal y pense. http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg