Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!news.glorb.com!news-out.readnews.com!transit3.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail From: "Lew" Subject: Re: Sharing ListSelection Message-ID: X-Comment-To: comp.lang.java.gui Newsgroups: comp.lang.java.gui In-Reply-To: References: Content-Type: text/plain; charset=IBM437 Content-Transfer-Encoding: 8bit X-Gateway: time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92] Lines: 32 Date: Wed, 27 Apr 2011 15:50:19 GMT NNTP-Posting-Host: 96.60.20.240 X-Complaints-To: news@tds.net X-Trace: newsreading01.news.tds.net 1303919419 96.60.20.240 (Wed, 27 Apr 2011 10:50:19 CDT) NNTP-Posting-Date: Wed, 27 Apr 2011 10:50:19 CDT Organization: TDS.net Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.gui:4391 To: comp.lang.java.gui Lew wrote: >> nit: the second initialization to 'false' is redundant, as 'false' >> is the default value. John B. Matthews wrote: > Correct and interesting. I sometimes indulge in gratuitous > initialization to signify that the code relies on that initial value > (and no other). By analogy, these expressions all evaluate to 10 While it is a nit, it is interesting to me that the compiler and runtime are actually forbidden to remove the extra initialization. JLS 12.5, Just after memory is allocated for the instance, > all the instance variables in the new object, including those declared in > superclasses, are initialized to their default values (-o4.12.5). then, initialization procedure step 4 is to > Execute the instance initializers and instance variable initializers > for this class, ... (In some early implementations, the compiler > incorrectly omitted the code to initialize a field if the field > initializer expression was a constant expression whose value was > equal to the default initialization value for its type.) -- Lew --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24