String name = "John";
// prints true to standard system output.
System.out.print(!name.equals("Alex"));
String word = "Hello"; // Declare String.
word.equalsIgnoreCase("hELlO"); // Returns true.
word.equals("Hello"); // Returns true.
word.equals("heLLo"); // Returns false.
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.
}