string java não é igual
String name = "John";
// prints true to standard system output.
System.out.print(!name.equals("Alex"));
Helpless Hornet
String name = "John";
// prints true to standard system output.
System.out.print(!name.equals("Alex"));
// Int version
int i = 2;
if (i != 3) {}
// String version
String s = "a";
if(!s.equals("b")) {}
String first = "Hello";
String second = "hELLo";
if(first.equal(second)) {
// Check if first string is equal to second string. lower/upper case matter.
}
if(first.equalsIgnoreCase(second)) {
// Check if first string is equal to second string. lower/upper does not matter.
}