class MethodCallStack { private int x = 3; void incr(int dx){ x += dx; } void times(int tx){ x*= tx; } void choose(int n){ if (n%2 == 0) incr(n); else times(n); if (n>0) choose(n-1); } public static void main(String[] args){ MethodCallStack mcs= new MethodCallStack(); mcs.choose(3); } }