public class recursion{

public static void Fibbo(String str,int n){ if(str.length() == n){ for(int k = 0; k <= 3; k++){ System.out.println('x'); } return; } if (str.charAt(n)=='x'){ Fibbo(str,n+1); return; } System.out.println(str.charAt(n)); Fibbo(str,n+1); } public static void main(String args[]){ String str = "axbcxxd"; int n = 0; Fibbo(str,n); } }