Can you use == for string in Java?

In String, the == operator is used to comparing the reference of the given strings, depending on if they are referring to the same objects . When you compare two strings using == operator, it will return true if the string variables are pointing toward the same java object. Otherwise, it will return false .

Sizin İçin Seçtik  How can you tell if two objects are the same?

Leave a Reply

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