Comment on Tutorial - equals( ) Versus == in Java By Mashoud
Comment Added by : Gunjan
Comment Added at : 2010-09-08 19:24:24
Comment on Tutorial : equals( ) Versus == in Java By Mashoud
Hello Friends ,
s1 == s2 will always give false . Because s1 == s2 gives refers to the different memory location .
Note that , in java every object refers to the different memory locations. So , == will always give you false.
If we declare s1=s2 then it will give true . While s1.equals(s2) compares the character within the String object . So it will give true.
- Data Science
- Cloud Computing
- Java Beans
- Mac OS X
- Office 365
- Tech Reviews
Subscribe to Tutorials
4. Hi Fred, I found this link which has more explanat
View Tutorial By: Boulvat at 2012-09-25 08:36:48
5. its realy gud which clears minor douts regarding t
View Tutorial By: Shripad at 2010-01-19 05:40:41
9. Thanks for the tutorial. I didn't get a lot of tra
View Tutorial By: jordan at 2012-05-16 13:03:45