I've doubts about using recursive calls in Java, since there's nothing protecting you from StackOverflow errors. Personally, I'd stay away from it with Java and instead write an iterative solution.