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
1. Hi wei long, did you download all the five program
View Tutorial By: Ramlak at 2008-06-23 03:26:31
3. @bibiki, you are right for simpler conditions what
View Tutorial By: Marcin at 2012-04-05 02:34:13
5. when i trying to build the above program it is giv
View Tutorial By: bhagyalaxmi at 2008-10-10 23:45:45
6. Easy and Wonderfulimple Example...to undersatnd th
View Tutorial By: Chaitanya at 2010-04-04 02:27:04