Can you do == in Java?

In Java Strings, the == operator is used to check the reference of both the string objects and equals() method used to check the value equality of both strings. When we assign a string value to the string variable, the JVM will check if the string with the equal value already present in the string pool or not.

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

Leave a Reply

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