Here is a general form of part of my code, it asks the user for an input read by in.next(); which then is used in an if statement: if (input == "one") { do whatever }, however when i type in one, the if statement is skipped despite, what seems to me like a valid comparision, what am i doing wrong?
Scanner in = new Scanner(System.in);
String input = in.next();
if (input == "one") {
}
user inputs one.
Aucun commentaire:
Enregistrer un commentaire