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
1. where i can find Messageressourse.properties......
View Tutorial By: sanjiv at 2013-09-07 06:59:19
2. this is good, but i need a simple program about sh
View Tutorial By: ramalakshmi at 2011-01-05 03:38:26
6. Definitely Struts is great. I have posted an artic
View Tutorial By: Ashish at 2008-09-02 08:04:49
7. Hi puru, The syntax is substring(int startIndex, i
View Tutorial By: Fazal at 2008-09-12 20:17:53
9. Yesterday afternoon, I tried a lot of different su
View Tutorial By: Leo at 2011-07-26 04:19:15
10. Thanks so much, this was extremely helpful and rea
View Tutorial By: gabrielle at 2013-10-04 22:07:17