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. thanks i am fresher to j2me i understand the conce
View Tutorial By: anusha at 2010-04-20 00:32:10
5. is anyone going to post the complete version of th
View Tutorial By: anon at 2009-04-21 12:26:51
7. @Askia-Just change RadioButton1 to RadioButton2 in
View Tutorial By: Nelson at 2010-03-06 23:12:36
10. it giving me error in following statment (using Li
View Tutorial By: Priyadarsan at 2007-11-27 22:31:56