What is the difference between equals () and equalsIgnoreCase ()?

The only difference between them is that the equals() methods considers the case while equalsIgnoreCase() methods ignores the case during comparison . For e.g. The equals() method would return false if we compare the strings “TEXT” and “text” however equalsIgnoreCase() would return true.

Sizin İçin Seçtik  How do you find the length of a string in Java?

Leave a Reply

Your email address will not be published. Required fields are marked *

What is the difference between equals and equalsIgnoreCase?

The only difference between them is that the equals() methods considers the case while equalsIgnoreCase() methods ignores the case during comparison . For e.g. The equals() method would return false if we compare the strings “TEXT” and “text” however equalsIgnoreCase() would return true.

Sizin İçin Seçtik  How do you correctly override the hashCode () and equals () methods in Java?

Leave a Reply

Your email address will not be published. Required fields are marked *