Question: I need to print a String letter by letter with a \* between each letter.
I want to find a recursive solution and not an iterative one. The signature must be :

```java
public static String allStar(String a);

```

Answer: 
Try this where first the string is split into array of strings of each character and then joined together with a `*` character in between them.

```
System.out.println(String.join("*",  a.split("")));

```
```java
class AllStar {
    public static String allStar(String a){
        return allStar(0, a, "");
    }
    public static String allStar(int ch, String a, String res){
        if(a.length() == 0){
            return res;
        }
        if(ch == a.length() - 1){
            res += a.charAt(ch);
            return res;
        }
        else{
            res += a.charAt(ch) + "*";
            return allStar(ch + 1,a,res);
        }
    }
    public static void main(String args[]){
        System.out.println(allStar("aritro"));
    }
}

```

Explanation :

We pass in the starting character index in the `ch` argument. `a` takes in the String which is to be printed according to the specified format, i.e., with stars. `res` takes in the String where the result should be stored. The if-statement checks if the letter is the last one. If true, it just appends the letter without a star to the `res` String as it is specified that stars should be between letters. It also returns the formatted String stored in `res`. If it is not the last letter, `ch` is incremented, the original String is passed as it is, and the formatted String is passed on as well. This continues till the last character is reached.