阅读背景:

如何避免Java方法中的无用返回

来源:互联网 

I have a situation where the return statement nested in two for loops will always be reached, theoretically. The compiler disagrees and requires a return statement outside of the for loop. I'd like to know an elegant way to optimize this method that's beyond my current understanding, none of my attempted implementations of break seem to work. Attached is a method from an assignment that generates random integers and returns the iterations cycled through until a second random integer is found, generated within a range passed into the method as an int parameter.I have a situation where the return statement n




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: