vendredi 27 février 2015

What use does the == operator have for String?

In Java, if you want to compare Strings by value you need to use the String.equals method. This leads me to my question.


Why is the == operator not overridden to do the deep comparison ? Does it actually have any uses ? Why would one compare String references ?


Edit: I am not asking what the == operator does. I am not asking how to compare Strings in Java.


I am asking what uses does the == operator have for String in Java, if any at all.


Aucun commentaire:

Enregistrer un commentaire