Comment on Tutorial - equals( ) Versus == in Java By Mashoud



Comment Added by : vijay

Comment Added at : 2011-08-21 15:09:41

Comment on Tutorial : equals( ) Versus == in Java By Mashoud
what ll be result for s1==s2 and s1.equals(s2) for following cases?
1)String s1="hello";
String s2="hello";

2)String s1 = new String("Hello");
String s2 = new String("Hello");

3)String s1="hello";
string s2=s1;


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. Nice code. It is working Fine.Thnx
View Tutorial          By: Tapasya Shukla at 2010-11-12 06:32:45

2. Hi Ramalak, I am suffering with the same error as
View Tutorial          By: Divya at 2008-11-06 22:46:12

3. Nice article .... Thank you...
View Tutorial          By: viswa at 2012-06-16 17:21:59

4. Great!! Many thanks!
View Tutorial          By: Louis at 2013-06-01 23:16:41

5. Hi sir,
i have a critical problem when i dn

View Tutorial          By: Thiru at 2015-09-30 07:02:43

6. MySQL Connector/J supports only TCP/IP connections
View Tutorial          By: Java Training Institute In Chennai at 2012-09-13 12:37:44

7. When i ran the code using 02 GSM X230D dongle i go
View Tutorial          By: azban at 2014-11-01 11:57:21

8. Really awesome keep posting ........
View Tutorial          By: viswanath at 2013-01-30 07:38:13

9. I have a mac book dual booting with snow leopard (
View Tutorial          By: david at 2015-06-27 15:33:07

10. Incomplete article; Singleton session bean? And re
View Tutorial          By: vaibhav sakpal at 2013-08-29 07:35:37