SHARE
TWEET

Untitled

a guest Oct 21st, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class StringRecursion
  2. {
  3.     public static void printLetters(String str)
  4.     {
  5.         if(str==null)
  6.         {
  7.             System.out.println(str);
  8.         }
  9.         else
  10.         {
  11.             System.out.print(str.charAt(0)+", ");
  12.             str=str.substring(1, str.length());
  13.             printLetters(str);
  14.         }
  15.     }
  16.    
  17.     public static void main(String[] args)
  18.     {
  19.         printLetters("Testing 123");
  20.     }
  21.  
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top