lundi 1 août 2016

Why user input in Java "+" Does Not Equel "+" [duplicate]

This question already has an answer here:

Scanner keyboard = new Scanner(System.in);
String input = keyboard.next();
System.out.println(input == "+");

How come the print statement prints false if the user enters "+"?

Aucun commentaire:

Enregistrer un commentaire