Comment on Tutorial - equals( ) Versus == in Java By Mashoud
Comment Added by : Miguel JImenez
Comment Added at : 2009-05-10 14:28:46
Comment on Tutorial : equals( ) Versus == in Java By Mashoud
Thanks for the explanation.
It makes sense. However, I tried this:
String s1 = "Hello";
String s2 = "Hello"; // new String(s1);
System.out.println(s1 + " equals " + s2 + " -> " + s1.equals(s2));
System.out.println(s1 + " == " + s2 + " -> " + (s1 == s2));
and I don't understand the result.
Can someone explain why both result in equal. please?
- Data Science
- Cloud Computing
- Java Beans
- Mac OS X
- Office 365
- Tech Reviews
Subscribe to Tutorials
3. hi can u send me the complete working code for sen
View Tutorial By: Brajesh at 2011-04-21 03:07:40
6. oh tnx a lot!i'v been lookin for a code like this!
View Tutorial By: LES at 2012-01-13 12:55:09
8. The example program was very easy to understand un
View Tutorial By: vijay at 2011-12-27 07:34:35
9. hi could u tell me how to download a file using se
View Tutorial By: akki at 2013-02-19 05:52:03