class Test
{
static int a;
static
{
a = 4;
System.
out.
println ("inside static block\n"); System.
out.
println ("a = " + a
); }
Test()
{
System.
out.
println ("\ninside constructor\n"); a = 10;
}
public static void func()
{
a = a + 1;
System.
out.
println ("a = " + a
); }
public static void main
(String[] args
) {
Test obj = new Test();
obj.func();
}
}
Y2xhc3MgVGVzdAp7CiAgICBzdGF0aWMgaW50IGE7CgogICAgc3RhdGljCiAgICB7CiAgICAgICAgYSA9IDQ7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuICgiaW5zaWRlIHN0YXRpYyBibG9ja1xuIik7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuICgiYSA9ICIgKyBhKTsKICAgIH0KCiAgICBUZXN0KCkKICAgIHsKICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4gKCJcbmluc2lkZSBjb25zdHJ1Y3RvclxuIik7CiAgICAgICAgYSA9IDEwOwogICAgfQoKICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBmdW5jKCkKICAgIHsKICAgICAgICBhID0gYSArIDE7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuICgiYSA9ICIgKyBhKTsKICAgIH0KCiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKQogICAgewoKICAgICAgICBUZXN0IG9iaiA9IG5ldyBUZXN0KCk7CiAgICAgICAgb2JqLmZ1bmMoKTsKCiAgICB9Cn0=