Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 29 Aug 2012 04:54:29 -0500 Date: Wed, 29 Aug 2012 02:54:30 -0700 From: Patricia Shanahan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: startup code References: <9b4cce4e-99b1-414f-a033-1acf9200e90a@googlegroups.com> <2r4q38p3790lc86fpttn4arc58m5m1tjen@4ax.com> <3926176c-0940-4080-95a1-fb67bbbec50e@googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Lines: 29 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 70.230.200.172 X-Trace: sv3-M2ApYqc0y3caOzu9KdP3loXcfC/CKXi3Y50S/kIlo2FQWML2To5R3N5UTUmukMmtppQegu1+sUsXRgt!RIGR2Ut294508fXUom1/8VQfjr89+iNI1Fxm6JYFWdhfS7H5JrWFim1T7DETRH5g6amoag/ZLBcr!saxNBfGZfq35wwpC8WCdrdqsYP1Vc/P9S8EtkQS+RK9gXsM= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2476 Xref: csiph.com comp.lang.java.programmer:18389 On 8/29/2012 2:42 AM, Patricia Shanahan wrote: > On 8/29/2012 12:21 AM, Roedy Green wrote: >> On Tue, 28 Aug 2012 14:00:47 -0700 (PDT), Lew >> wrote, quoted or indirectly quoted someone who said : >> >>> >>> The class init block won't run until the class is initialized >> >> I think he means by "the program" the class name invoked on the >> command line. In that case the static init blocks in that class will >> execute even before the main method. > > It is very important to say that only the class containing the main > method is initialized on program start-up. I would agree with "static > init block in the class containing the main method" as an answer to the > original question. ... Correction to my own post. In addition to the class that contains the main method, there are other classes, such as its superclasses, classes needed to execute its initialization code, and system classes that do get initialized on start-up. If a class is not needed to run the main method it does not even get loaded, let alone initialized. Patricia