in this code, how can I access the variable i?
class
Test {
static {
int i=20;
}
public static void main(
String[] args) {
System.out.println(i); // compilation error
Test t = new Test();
System.out.println(t.i);// compilation error also
}
}
it seems that impossible to access the variable i... how can I use it in this case?
thx!
}
}