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. I don't undrstnd.. cz I think in recurs the method
View Tutorial          By: Alina Ali at 2014-11-13 03:06:17

2. Simpler example:

import java.io.*;

View Tutorial          By: Joseph Harner at 2011-12-04 23:20:48

3. please correct things....and plz dont misguide
View Tutorial          By: amit verma at 2015-02-19 08:44:55

4. what about the remaining explanation......do anyth
View Tutorial          By: raki at 2011-11-07 10:47:25

5. This is a bad example, it does not check if the al
View Tutorial          By: Erik at 2011-02-12 07:16:20

6. Thanks alot ,,, it is really more the excellent n
View Tutorial          By: SaraFaqera at 2013-12-16 16:00:07

7. hellow my name is samer, i have a project of final
View Tutorial          By: samer flayha at 2011-08-17 09:37:16

8. for me also The code gives the following exception
View Tutorial          By: ashitha at 2007-09-12 03:09:12

9. thanks brother
View Tutorial          By: shakeel at 2012-09-12 16:21:03

10. Good example thank you so much
View Tutorial          By: Albadri at 2011-05-14 15:48:17