Can you use != For strings in Java?

Note: When comparing two strings in java, we should not use the == or != operators . These operators actually test references, and since multiple String objects can represent the same String, this is liable to give the wrong answer.

Sizin İçin Seçtik  İlaç 1x2 ne demek?

Leave a Reply

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

Can you use == for strings 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.31 Oca 2020

Sizin İçin Seçtik  Sufi THETA nedir?

Leave a Reply

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