Study the code below and note how static variables are declared. Also, notice the scope of each variable within the code. Then, enter and execute the code below:
//Save this code as StaticInitializationBlock.java
class A
{
static int i;
static
{
System.out.println(1);
i = 100;
}
}
public class StaticInitializationBlock
{
static
{
System.out.println(2);
}
public static void main(String[] args)
{
System.out.println(3);
System.out.println(A.i);
}
}