I want and to be calculated on the same object. However, what happens is the following: after is calculated, one row of (and then another within the recursion and another ...). Now, when has calculated it has a that is empty!
1. This confuses me regarding how Java handles recursion. Why is the object getting modified? I was under the assumption that it should be a "local" data at every recursion level.
2. How can we rewrite the code to get the desired behavior?