Return a value or not does not matter for a recursive function indeed. The core part is to terminate it. So I agree with you that something is wrong with the termination condition. So in my...
Type: Posts; User: garymar2013
Return a value or not does not matter for a recursive function indeed. The core part is to terminate it. So I agree with you that something is wrong with the termination condition. So in my...
The problem lies in the recursive function, which must return something to get the previous level where it was invoked. Pleaes try the following:
public class RecursiveFunctionTest {
private...