Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "javax.swing.JSnarker" Newsgroups: comp.lang.java.programmer Subject: Re: "Small" Program Challenge. Date: Sun, 17 Jun 2012 23:43:23 -0400 Organization: media lab? Lines: 32 Message-ID: References: <4fde76ce$0$287$14726298@news.sunsite.dk> NNTP-Posting-Host: 3urdS3lMyXHJXrtKy7vOkg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: NewsTap/3.5.5 (iPhone/iPod Touch) X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.java.programmer:15371 On 17/06/2012 11:40 PM, Daniel Pitts wrote: > In any case, I think the other challenge was more interesting. My > solution to the "shortest" source is 60 characters long. The first two > lines are simply a ruler, and not part of the source code. > > 1 2 3 4 4 6 > 123456789012345678901234567890123456789012345678901234567890 > enum H{W;System s;{s.out.println("Hello World");s.exit(0);}} > > You would compile whatever file H was in (it needn't be in H.java since > it isn't public). Then execute with "java H" > > Note, this no longer works in Java 7. It appears a method with the > signature "public static void main(String[])" is now required, where it > could have been omitted in the past (as in my example). That's pretty silly. Of course, if you don't require it to terminate, only to not print anything else after "Hello World", you can use > 1 2 3 4 5 > 123456789012345678901234567890123456789012345678901234 > enum H{W;{System.out.println("Hello World");for(;;);}} ;) -- public final class JSnarker extends JComponent A JSnarker is an NNTP-aware component that asynchronously provides snarky output when the Ego.needsPuncturing() event is fired in cljp.