mercredi 15 novembre 2017

If/Else with Input String Isn't Working

    String stringInput = input.nextLine();

    if (stringInput.toLowerCase() == "y")
    {
        System.out.print("True");
    }

For some reason, this If statement isn't working. I enter the letter y in the console, put it doesn't output "True". Any ideas?

Aucun commentaire:

Enregistrer un commentaire