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: 
Beshambher's answer is a neat and easy way to do it. But if you want to do it recursively then :

```java
public static String allStar(String a) {
    if(a == null || a.isEmpty()) {        
        return "";
    }

    if(a.length() == 1) {
        return a;
    }        
    return  a.charAt(0) + "*" + allStar(a.substring(1));
}

```
Example implementation using overloaded functions `addStar(String str)` and `addStar(int pos, String str)`:

```
public static String addStar(String str) {
    if (null == str || str.isEmpty()) {
        return str;
    }
    return addStar(0, str);
}

static String addStar(int pos, String str) {
    if (pos == str.length() - 1) {
        return Character.toString(str.charAt(pos));
    }
    return str.charAt(pos) + "*" + addStar(pos + 1, str);
}

```

Tests

```java
System.out.println(addStar(null));
System.out.println("'" + addStar("") + "'");
System.out.println(addStar("a"));
System.out.println(addStar("ab"));
System.out.println(addStar("abcd"));

```

Output

```
null
''
a
a*b
a*b*c*d

```