This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes static initialiser blocks Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "static initialiser blocks" Watch "static initialiser blocks" New topic
Author

static initialiser blocks

Soni Prasad
Ranch Hand

Joined: Mar 09, 2005
Posts: 97
Am I right that the variables defined in static initializer blocks are local to it and can not be used outside the block? If it is so then What is the need of these blocks?
Can any body tell me about some detailed online document on static initializers.

soni.


SCJP 1.4, SCBCD 1.3
S.L.Narayanan
Ranch Hand

Joined: Apr 01, 2005
Posts: 431
Hi Soni

The following is a good article on static initializers.

Static Initializer


SCJP 1.4, SCWCD 1.4, SCBCD 1.3, NEXT--->IBM XML
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: static initialiser blocks
 
It's not a secret anymore!