Reversing a sentence using recursion in java
问题 I am trying to reverse a sentence using recursion and print it out backwards. Right now after it prompts me to type in a sentence, it does not allow me to enter any input and ends. Is there something wrong with sc.nextLine()? How do I input a sentence as a string. private static void testNum3() { System.out.print("Type in a sentence:"); String sentence= sc.nextLine(); System.out.println(reverse(sentence)); } public static String reverse (String sentence) { if (sentence.length()== 0) return