if (correctAnswer.equals(userChoice.toLowerCase())) {
System.out.println("Your have provided the correct answer. Well done!");
Where I have .equals above as a String operation, is there a .notequals equivalent for it in Java?
if (correctAnswer.equals(userChoice.toLowerCase())) {
System.out.println("Your have provided the correct answer. Well done!");
Where I have .equals above as a String operation, is there a .notequals equivalent for it in Java?
You can use negation operator ! to reverse result of equals method like
if (!correctAnswer.equals(userChoice.toLowerCase()))