Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: v_borchert@despammed.com (Volker Borchert) Newsgroups: comp.lang.java.programmer Subject: Re: elementary loops Date: 22 Jun 2015 19:17:01 GMT Organization: Private site at Eddersheim, Germany Lines: 28 Distribution: world Message-ID: References: X-Trace: individual.net 12Klcxk3+eLVLCyCyapnEQTfwpDbY8bc8Oy+/EVXWqng+6cfq9 Cancel-Lock: sha1:JoLYpoBYItfvbvbbWfT7YW+8DOA= Xref: csiph.com comp.lang.java.programmer:31840 Eric Sosman wrote: > On 6/22/2015 12:15 PM, Stefan Ram wrote: > > public class Main > > { public static void main( final java.lang.String[] args ) > > { short i = -1; > > int j = -1; > > for( int k = 0; k < 65; ++k ){ i >>>= 1; j <<= 32; } > > java.lang.System.out.println( i ); > > java.lang.System.out.println( j ); }} > > > > I hope you can all predict what this prints and explain why. > > It prints "Rejected by code review," and the explanation > is "Because it's badly formatted, and silly to boot." I think it'll rather throw a DoYourHomeworkYourselfException, which is a well known subclass of SecurityException. > In the actual code, are there any clues as to what the author > intended to accomplish? I'd be interested in any explanation, > even if it's largely speculative. It looks suspiciously like homework. -- "I'm a doctor, not a mechanic." Dr Leonard McCoy "I'm a mechanic, not a doctor." Volker Borchert