Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Test {
- public static void main(String[] args) {
- int x = 0;
- recursiveMethod(x);
- }
- private static int recursiveMethod(int x) {
- x += 1;
- System.out.println("x value is: " + x);
- if(x < 10000) {
- recursiveMethod(x);
- }
- return x;
- }
- }
Add Comment
Please, Sign In to add comment