当前计算的结果依赖于之前的部分结果,所以,在每次后续递归调用中,我们向前传递那些结果。
The result of the present computation depended on the partial results before it, so in each successive recursive call, we pass those results forward.
区别在于,使用递归函数极少被迫修改任何一个变量——只需要将新值作为参数传递给下一次函数调用。
The difference is that with recursive functions, you rarely have to modify any variable — you just pass the new values as parameters to the next function call.
为了在递归方法中传递,匿名类应该扩展方法已知的包装器类型。
To pass this to a recursive method, the anonymous class should extend a wrapper type known to the method.
应用推荐