Why string == does not work in Java?

equals(String otherString) function to compare strings, not the == operator. This is because the == operator only compares object references , while the String. equals() method compares both String ‘s values i.e. the sequence of characters that make up each String .

Sizin İçin Seçtik  How do you calculate work per hour?

Leave a Reply

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