Java equal string
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. }
java string not equal
String name = "John"; // prints true to standard system output. System.out.print(!name.equals("Alex"));
Source: www.quora.com