Hi everyone,
Why does this return true?
String s1 = "hola";
String s2 = "hola";
if(s1 == s2) return true;
By the way... I'm teaching an introductory java course and I know everything about objects and memory allocation... I also know C, PHP, Assembly, Java, etc. I mention this so you don't start explaining me about objects and stuff like that :-)
I just want to know why the code above returns true even though s1 and s2 are supposed to be 2 different String objects... I just don't get it. Is it a Java bug??
Thx.