joseleonweb

Untitled

Feb 1st, 2021
590
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class RecursionExample {
  2.  
  3.     public static void main(String[] args) {
  4.         recurseMethod(4);
  5.     }//end method main
  6.    
  7.     static void recurseMethod(int num){
  8.         if(num == 0)
  9.             return;
  10.         else{
  11.             System.out.println("hello " + num);
  12.             recurseMethod(--num);
  13.             System.out.println(""+num);
  14.             return;
  15.         }//endif
  16.     }//end method recurseMethod
  17. }//end class RecursionExample
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×