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?
- Cloud Computing
- Java Beans
- Mac OS X
- Office 365
- Tech Reviews
Subscribe to Tutorials
2. Dude how did you used out.print() method it is giv
View Tutorial By: Hardik at 2013-02-18 15:37:09
5. I have a source code of j2ee. but i want to conver
View Tutorial By: bangaram at 2011-06-07 09:28:45
8. i am developing a video streaming pc server to j2m
View Tutorial By: ziathegreat at 2009-05-19 13:19:15