fork(1) download
  1. public class Main {
  2.  
  3. public static void main(String[] args) {
  4. Main main = new Main();
  5. main.myMethod(5);
  6. }
  7.  
  8. void myMethod( int counter)
  9. {
  10. System.out.println("Method called with argument: "+counter);
  11. if(counter == 0) return;
  12. else {
  13. System.out.println(""+counter);
  14. myMethod(--counter);
  15. return;
  16. }
  17. }
  18.  
  19. }
Success #stdin #stdout 0.06s 380160KB
stdin
Standard input is empty
stdout
Method called with argument: 5
5
Method called with argument: 4
4
Method called with argument: 3
3
Method called with argument: 2
2
Method called with argument: 1
1
Method called with argument: 0