Article:
  Understanding the Interplay Between Utility Classes and Static Initialization
Subject:   Question on static initilizer
Date:   2006-06-14 20:24:31
From:   johnydep
Following is the piece of code


class A{
static int i = 0;
static {
i = 100;
j = 100; // line 1
j = j + 1; // line 2
i = get(){return m};//line 3
System.out.println(i);// line 4
}
static int j =10;
static int m =1000;
}


Question
line # 1: No error generated eventhough it is declared after assigning. Why?
line # 2: Exception is raised because of accessing undeclared variable. Then it should be true for line # 1 also. clarify
line # 4: the value of i is preinted as 0 not 1000 why?