I wrote a function to receive user input. Can't get the correct answer back. Always Failure. I am losing my mind right now.
public String getChoice() {
Scanner SC = new Scanner(System.in);
System.out.print("Ready to play? (Y/N) ");
String playChoice = SC.next(); // Input Y or N
playChoice = playChoice.replace("\n", "");
System.out.println("Input length is: " + playChoice.length());
System.out.println(playChoice);
if (playChoice == "N") {
SC.close();
return "Success N";
}
else if (playChoice == "Y") {
SC.close();
return "Success Y";
}
SC.close();
return "Failure"; // Always this one works
}