Guest User

Untitled

a guest
Jun 24th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.28 KB | None | 0 0
  1. public class Test {
  2.  
  3.     public static void main(String[] args) {
  4.  
  5.         int x = 0;
  6.         recursiveMethod(x);
  7.  
  8.     }
  9.  
  10.     private static int recursiveMethod(int x) {
  11.  
  12.         x += 1;
  13.         System.out.println("x value is: " + x);
  14.         if(x < 10000) {
  15.             recursiveMethod(x);
  16.         }
  17.  
  18.         return x;
  19.  
  20.     }
  21.    
  22.  
  23. }
Add Comment
Please, Sign In to add comment