Path: csiph.com!usenet.pasdenom.info!goblin1!goblin.stu.neva.ru!uio.no!hist.no!ntnu.no!not-for-mail From: Bent C Dalager Newsgroups: comp.lang.java.programmer Subject: Re: "Small" Program Challenge. Date: Thu, 14 Jun 2012 11:29:32 +0000 (UTC) Organization: Norwegian university of science and technology Lines: 38 Message-ID: References: NNTP-Posting-Host: microbel.pvv.ntnu.no X-Trace: orkan.itea.ntnu.no 1339673372 27578 129.241.210.179 (14 Jun 2012 11:29:32 GMT) X-Complaints-To: usenet@ntnu.no NNTP-Posting-Date: Thu, 14 Jun 2012 11:29:32 +0000 (UTC) User-Agent: slrn/pre1.0.0-18 (Linux) Xref: csiph.com comp.lang.java.programmer:15274 On 2012-06-13, Daniel Pitts wrote: > I saw a challenge Roedy posted on cljh, and I thought I might have a > slightly more interesting one. > > Write a Java program which outputs "Hello World" followed by a new line > (and nothing else). > > Now, do it using as few characters in the .java source code as possible. How much are you permitted to offload to the launcher? Trivial example of offloading: class A{public static void main(String[] a){System.out.print(a[0]);}} (69 chars) with launch instructions: run like this (bash command line example shown, other launch environments will have other ways of expressing the newline) $ java A "Hello World > " $ And how much can you offload to a hypothetical "library" function that just happens to do exactly what you want? class B{public static void main(String[] a){L.f();}} (52 chars) Cheers, Bent. -- Bent Dalager - bcd@pvv.org - http://www.pvv.org/~bcd powered by emacs