Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Jan Burse Newsgroups: comp.lang.java.programmer Subject: Re: method Date: Sun, 28 Aug 2011 19:40:53 +0200 Organization: albasani.net Lines: 18 Message-ID: References: <8fe8db85-d553-4b7c-90a6-56b9b4b938d9@bl1g2000vbb.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net RfXDQn5QlOzL5e0XW47u7Gkd19yJli6y9VH0y1/zuAeXpmII5AQgYpTVLK5dzdIs4SNEbKPJ+Bs+rrua4yUXZ/wiXU99LahklFdWcFoGbkNMkR8B4Gmd/n4oPTtw6hPt NNTP-Posting-Date: Sun, 28 Aug 2011 17:40:53 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="YwcRw8XhFUsOGs+kKD7ophx/sx/TAAqkDhNV+uODGa5agdDdKTgkO9r2RyQqM2KkzuAVDi23beVKFRo8VIl0q+r5WQbTiQcqsjBDmw1wo2rHNi5sWqToFCbt8bZBJPnX"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0) Gecko/20110820 Firefox/6.0 SeaMonkey/2.3.1 In-Reply-To: <8fe8db85-d553-4b7c-90a6-56b9b4b938d9@bl1g2000vbb.googlegroups.com> Cancel-Lock: sha1:WHYJMlFUIWYbG18ckEJ8C0MTh+A= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:7436 fattaneh schrieb: > hi everybody > is every body knows which method executes before main() and static() The static initializers are immediately called before the main() method is invoked for the first time. This might be long after the class has been loaded, and also by another thread than the thread that loaded the class. Accordingly to the JLS an eager calling of initializers is not allowed. This is in contrast to the linking of a class which can be done eager or lazy after the loading of the class and before its initialization. http://java.sun.com/docs/books/jls/third_edition/html/execution.html#12.4.1 Bye