fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main(String[] args) {
  11. test(5);
  12. }
  13. static void test(int n) {
  14. if (n > 0) {
  15. System.out.println("First step :" + n);
  16. test(n-1);
  17. System.out.println("Second step :" + n);
  18. }
  19. }
  20. }
Success #stdin #stdout 0.07s 380160KB
stdin
Standard input is empty
stdout
First step :5
First step :4
First step :3
First step :2
First step :1
Second step :1
Second step :2
Second step :3
Second step :4
Second step :5