I was tasked to make a program that took a string input, then reversed it using recursion. I'm getting a syntax error causing an exit code 1. Also, I'm sure there may be an error in the code as I'm not very strong with recursion. Any help with this (specifically this obnoxious syntax error which I can't seem to find) would be very helpful!
import java.util.Scanner; public class StringReverser { public static void main(String[] args) { String input; Scanner keyboard = new Scanner(System.in); System.out.println("Please enter a string to be reversed: "); input = keyboard.nextLine; reverse(input); } public static String reverse(String str) { if((null == str) || (str.length() <= 1)) { return str; } return reverse(str.substring(1)) + str.charAt(0); } }