class Test {
int y=1;
static int a=6;
// Test() passed into int a=6
Test() {
this(a);
}
//Test(a) sign Test(int x), x=a=6, x>y true
//if y=7 not 1, x>y false, output will be 22
Test(int x) {
if ( x > y )
a = y*2;
else
a = y*3;
a++;
}
public static void main(String [] args) {
Test t = new Test();
System.out.println(a);
}
}
>>Thanks Suneeta question, let me learn lot