The value of static member variable can be modified in any static/instance intializer block and/or static or non-static method, and constructor.
Here is the demo:
========================================================
public class Reply
{
static int i = 10;
public static void main(
String args[]) {
Reply r = new Reply();
r.try1();
try2();
System.out.println(i);
}
static
{
i = 20;
System.out.println("The value of i is : " + i);
}
{
i = 30;
System.out.println("The value of i is : " + i);
}
Reply()
{
i = 40;
System.out.println("The value of i is : " + i);
}
void try1(){
i = 50;
System.out.println("The value of i is : " + i);
}
static void try2(){
i = 60;
System.out.println("The value of i is : " + i);
}
}
========================================================
HTH
--Farooq