how to turn this "for" loop into a recursion (java)? : This is my code that generates any possible permutation in the given length (n) from string s (the abc):
    
      public String binary (int n, String str, int i){
            String s="abcdefghijklmnopqrstuvwxyz";
            //i=s.length();
            if (n==0){
                System.out.println(str);
                return str;}
            if (i==s.length()){
                System.out.println(str);
                return "";}
    
            for (i=0;i<26;i++){
                    binary (n-1,str+s.charAt(i), i);}
    
            return "";
         }

My question is how to convert my "for" loop into a recursion? I am not allowed to use any loops in my homework. Thanks!