Originally posted by vinay17in:
WHAT IS STATIC INITIALIZATION AND NON STATIC INITIALIZATION?
Non Static inialization is the standard intitalization that you do by assignment of a class variable
class A{
int i = 10;
private static boolean debug = false;
...
or in a constructor
class A{
int i;
A(int k){
i = k;
static intialization is the intialization of static varables using a block of static code.
From Deitel&Dietel
A static initiaizer block allows complex initialization of a classes's static variables when the class is loaded.
The example that they use is to initalize a static array of gif images.
public A{
static ImageIcon c[];
static{
for(int i = 0 ; i < 5 ; i ++)
{
//get the images into the array
}//end for
}//end static code block
Hope this clears things up
[This message has been edited by Carl Trusiak (edited June 24, 2000).]