Why does the boolean conditions like condition
always return true ? Even if the variable reponse
is equal to constants OUI
or NON
;
final String OUI = "O";
final String NON = "N";
String reponse = OUI;
// some code was omitted
do {
// some code was omitted
// true
boolean condition = false;
do {
System.out.println(MSG_SOL_TRONCON);
reponse = mScanner.nextLine();
// Debug
System.out.println("Reponse:" + reponse + ":fin");
/*
// Boucle infinie, problème avec la condition
// Infinite Loop
condition = !((reponse == NON) || (reponse == OUI));
System.out.println("Condition : " + condition);
if (condition) {
System.out.println(MSG_ERR_TRONCON);
} // if
*/
} while(condition);
} while (reponse != NON);