Please tell me where I went Wrong?

import java.util.;
import java.lang.
;

class prog
{
public static void func(String str, String res){
if(str.length() == 0){
System.out.println(res);
return;
}
char r1 = (char)(64 + Integer.parseInt(""+str.charAt(0)));
String ros1 = str.substring(1);
func(ros1,res+r1);

    for(int i = 0; i < str.length()-1; i++){
        char r2 = (char)(64 + Integer.parseInt(""+str.charAt(i)+str.charAt(i+1)));
        String ros2 = str.substring(0,i)+str.substring(i+2);
        func(ros2,res+r2);
    }
}
public static void main(String args[])
{
    
    String str = "121";
    func(str,"");
}

}

At every point, you can have two recursive calls, 1 for the single digit and call for str.substring(1), and 2 for the double digits and call for str.substring(2) only if the digits are less than 27.
Imagine it as number to character mapping with just one addition of the second call. Use your previous recursion knowledge

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.