public class Twisty
{
{ index = 1; } //need clarification here
int index;
public static void main(String[] args)
{
new Twisty().go();
}
void go()
{
int [][] dd = {{9,8,7}, {6,5,4}, {3,2,1,0}};
System.out.println(dd[index++][index++]);
}
}
In the above code, inside the instance initialization code, index is used. But it is declared only after the block. This code compiles fine but i just need more detail to understand this. Is it that the class will first load all its instance variables before invoking any init blocks?? what if the code contained any static init blocks?? which one willl load first??