Programming Code Center(PCC)
[JAVA]

(PCC)::[How-to-write-Java-Program-to-Reverse-a-Sentence-Using-Recursion]::[java]

File Name : Reverse.java

//Example: Reverse a Sentence Using Recursion
public class Reverse {

    public static void main(String[] args) {
        String sentence = "Go work";
        String reversed = reverse(sentence);
        System.out.println("The reversed sentence is: " + reversed);
    }

    public static String reverse(String sentence)
    {
        if (sentence.isEmpty())
            return sentence;

        return reverse(sentence.substring(1)) + sentence.charAt(0);
    }
}

Output :

Reverse.jpg