I've been coding in python for a while, but I just started learning java. I am building hangman currently and am getting a strange error. After running this code:
System.out.println("Guess a letter: ");
String userInput = input.nextLine();
char letterGuessed = userInput.charAt(0);
it throws String index out of range. What's strange is that it doesn't even let me type anything in, and it just skips to the letterGuessed line. Does anyone know why this is happening?